PHPackages                             lessmore92/swoole-websocket-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lessmore92/swoole-websocket-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lessmore92/swoole-websocket-client
==================================

Easy-To-Use Swoole Websocket Client

v1.0.1(4y ago)529MITPHPPHP ^7.4|^8.0

Since Jun 21Pushed 4y ago2 watchersCompare

[ Source](https://github.com/lessmore92/swoole-websocket-client)[ Packagist](https://packagist.org/packages/lessmore92/swoole-websocket-client)[ RSS](/packages/lessmore92-swoole-websocket-client/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Easy-to-use Swoole WebSocket Client
===================================

[](#easy-to-use-swoole-websocket-client)

Installation
------------

[](#installation)

```
composer require lessmore92/swoole-websocket-client

```

Requirements
------------

[](#requirements)

- PHP&gt;=7.4
- [openswoole](https://openswoole.com/docs/get-started/installation)-4.11.1 (not tested other versions, maybe it works.)

Usage
-----

[](#usage)

Just pass the web socket URL to `WebSocketClient`.

### Note:

[](#note)

- This library is for CLI-based scripts and does not work for web-based ones.
- Because of web socket is async (and maybe be an always running task) it needs to be executed in the Swoole coroutine (`Co\run`); see sample below.

Sample
------

[](#sample)

```
use Lessmore92\Swoole\WebSocketClient;
use function Co\run;

require_once "vendor/autoload.php";

run(function () {
    $webSocketClient = new WebSocketClient('wss://socket.MyFancyApp.io:2053/app/app-key?protocol=7&client=js&version=7.0.6&flash=false');
    $webSocketClient->push('{"event":"pusher:subscribe","data":{"auth":"","channel":"msgs"}}');
    $webSocketClient->recv();

    while ($webSocketClient->client->connected)
    {
        $data = $webSocketClient->recv();
        var_dump($data);
    }
});

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1472d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1258149?v=4)[Mojtaba Bahrami](/maintainers/lessmore92)[@lessmore92](https://github.com/lessmore92)

---

Top Contributors

[![lessmore92](https://avatars.githubusercontent.com/u/1258149?v=4)](https://github.com/lessmore92 "lessmore92 (5 commits)")

---

Tags

phpphp-libraryswooleswoole-websocketwebsocketwebsocket-client

### Embed Badge

![Health badge](/badges/lessmore92-swoole-websocket-client/health.svg)

```
[![Health](https://phpackages.com/badges/lessmore92-swoole-websocket-client/health.svg)](https://phpackages.com/packages/lessmore92-swoole-websocket-client)
```

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B3.9k](/packages/guzzlehttp-psr7)[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k14](/packages/tempest-framework)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

185702.8k42](/packages/laudis-neo4j-php-client)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
