All Projects → amphp → Websocket Client

amphp / Websocket Client

Licence: mit
Async WebSocket client for PHP based on Amp.

Projects that are alternatives of or similar to Websocket Client

Pawl
Asynchronous WebSocket client
Stars: ✭ 448 (+439.76%)
Mutual labels:  async, websockets
Cpprestsdk
The C++ REST SDK is a Microsoft project for cloud-based client-server communication in native code using a modern asynchronous C++ API design. This project aims to help C++ developers connect to and interact with services.
Stars: ✭ 6,631 (+7889.16%)
Mutual labels:  async, websockets
Http Client
Async HTTP/1.1+2 client for PHP based on Amp.
Stars: ✭ 553 (+566.27%)
Mutual labels:  async, amphp
Microwebsrv2
The last Micro Web Server for IoTs (MicroPython) or large servers (CPython), that supports WebSockets, routes, template engine and with really optimized architecture (mem allocations, async I/Os). Ready for ESP32, STM32 on Pyboard, Pycom's chipsets (WiPy, LoPy, ...). Robust, efficient and documented!
Stars: ✭ 295 (+255.42%)
Mutual labels:  async, websockets
Postgres
Async Postgres client for PHP based on Amp.
Stars: ✭ 56 (-32.53%)
Mutual labels:  async, amphp
Amp
A non-blocking concurrency framework for PHP applications. 🐘
Stars: ✭ 3,457 (+4065.06%)
Mutual labels:  async, amphp
Ratchet
Asynchronous WebSocket server
Stars: ✭ 5,596 (+6642.17%)
Mutual labels:  async, websockets
Mysql
Async MySQL client for PHP based on Amp.
Stars: ✭ 235 (+183.13%)
Mutual labels:  async, amphp
Channelstream
Channelstream is a websocket communication server for web applications
Stars: ✭ 52 (-37.35%)
Mutual labels:  async, websockets
Uvicorn Gunicorn Fastapi Docker
Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python 3.6 and above with performance auto-tuning. Optionally with Alpine Linux.
Stars: ✭ 1,014 (+1121.69%)
Mutual labels:  async, websockets
Service Bus
PHP Service Bus (publish-subscribe pattern) implementation
Stars: ✭ 290 (+249.4%)
Mutual labels:  async, amphp
Sync
Synchronization primitives for PHP based on Amp.
Stars: ✭ 67 (-19.28%)
Mutual labels:  async, amphp
Aiowebsocket
Async WebSocket Client. Advantage: Flexible Lighter and Faster
Stars: ✭ 263 (+216.87%)
Mutual labels:  async, websockets
Ntex
framework for composable networking services
Stars: ✭ 381 (+359.04%)
Mutual labels:  async, websockets
websocket-server
WebSocket component for PHP based on the Amp HTTP server.
Stars: ✭ 81 (-2.41%)
Mutual labels:  websockets, amphp
Starlette
The little ASGI framework that shines. 🌟
Stars: ✭ 6,337 (+7534.94%)
Mutual labels:  async, websockets
Byte Stream
A non-blocking stream abstraction for PHP based on Amp.
Stars: ✭ 208 (+150.6%)
Mutual labels:  async, amphp
Brayns
Visualizer for large-scale and interactive ray-tracing of neurons
Stars: ✭ 232 (+179.52%)
Mutual labels:  async, websockets
Demo Chat
A small demo chat based on Aerys.
Stars: ✭ 18 (-78.31%)
Mutual labels:  async, amphp
Http Server
A non-blocking HTTP application server for PHP based on Amp.
Stars: ✭ 1,122 (+1251.81%)
Mutual labels:  async, amphp

websocket-client

Build Status CoverageStatus License

amphp/websocket-client is an async WebSocket client for PHP based on Amp.

Installation

This package can be installed as a Composer dependency.

composer require amphp/websocket-client

Requirements

  • PHP 7.2+

Documentation & Examples

More extensive code examples reside in the examples directory.

use Amp\Websocket\Client\Connection;
use Amp\Websocket\Message;
use function Amp\delay;
use function Amp\Websocket\Client\connect;

// Connects to the Kaazing echoing websocket demo.
Amp\Loop::run(function () {
    /** @var Connection $connection */
    $connection = yield connect('ws://demos.kaazing.com/echo');
    yield $connection->send("Hello!");

    $i = 0;

    while ($message = yield $connection->receive()) {
        /** @var Message $message */
        $payload = yield $message->buffer();
        printf("Received: %s\n", $payload);

        if ($payload === "Goodbye!") {
            $connection->close();
            break;
        }

        yield delay(1000); // Pause the coroutine for 1 second.

        if ($i < 3) {
            yield $connection->send("Ping: " . ++$i);
        } else {
            yield $connection->send("Goodbye!");
        }
    }
});

Versioning

amphp/websocket-client follows the semver semantic versioning specification like all other amphp packages.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

License

The MIT License (MIT). Please see LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].