PHPackages                             sinri/ark-websocket - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sinri/ark-websocket

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sinri/ark-websocket
===================

Ark WebSocket Component

0.1.9(4y ago)0109MITPHP

Since May 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/sinri/Ark-WebSocket)[ Packagist](https://packagist.org/packages/sinri/ark-websocket)[ RSS](/packages/sinri-ark-websocket/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (16)Used By (0)

Ark Websocket
=============

[](#ark-websocket)

[![Packagist Version](https://camo.githubusercontent.com/2b2d2cfb45ff4300ffa5d2b4c98c94d3c1122a774b8280167c8da87a72afaa85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f41726b2d576562536f636b6574)](https://camo.githubusercontent.com/2b2d2cfb45ff4300ffa5d2b4c98c94d3c1122a774b8280167c8da87a72afaa85/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73696e72692f41726b2d576562536f636b6574)

Usage
-----

[](#usage)

### Design your own class extending ArkWebSocketWorker and Daemon

[](#design-your-own-class-extending-arkwebsocketworker-and-daemon)

You need to design three actions when

- a new connection comes
- a new message comes
- an existed connection closed

You need to do unmask, mask and broadcast yourself inside.

Then you have to write a daemon to run in CLI mode. You can take `test` as an example.

### Set up your daemon

[](#set-up-your-daemon)

Your websocket server should listen on a port, and use a domain and path to be entrance for the frontend and the Load Balancer.

For example, your daemon, a file called `daemon.php` which runs `loop` method of `ArkWebSocketDaemon`, listens to 8000, your pages held by Nginx listens to 80, your domain uses `web.socket.com`, and your path would be `wss://web.socket.com/wss-service`.

Your steps:

1. Deploy your site, use Nginx or so, listen on 80 or so.
2. Run your daemon.php as `php -q daemon.php`, listen on 8000 or so; you may want to use `nohup` if you need.
3. Now config your SLB (80 or 443), when domain is `web.socket.com`
    1. while the path is `/wss-service`, send packages to 8000;
    2. otherwise, to 80;

Over.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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 ~33 days

Recently: every ~108 days

Total

14

Last Release

1751d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5821330?v=4)[Everstray Jun Sinri Edogawa](/maintainers/sinri)[@sinri](https://github.com/sinri)

---

Top Contributors

[![sinri](https://avatars.githubusercontent.com/u/5821330?v=4)](https://github.com/sinri "sinri (15 commits)")

### Embed Badge

![Health badge](/badges/sinri-ark-websocket/health.svg)

```
[![Health](https://phpackages.com/badges/sinri-ark-websocket/health.svg)](https://phpackages.com/packages/sinri-ark-websocket)
```

PHPackages © 2026

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