PHPackages                             virge/stork - 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. virge/stork

ActiveLibrary

virge/stork
===========

Virge::Stork is a library to help with PHP Based WebSockets, offering an abstraction above Ratchet to provide easy of implementation, horizontally scalable services, and per-topic subscription authentication

v3.1.1(7y ago)02041MITPHP

Since Apr 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/siosphere/virge-stork)[ Packagist](https://packagist.org/packages/virge/stork)[ RSS](/packages/virge-stork/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (5)Versions (34)Used By (0)

Virge::Stork
============

[](#virgestork)

Virge::Stork is a collection of services/components that provide a nice wrapper around Thruway () that provides a horizontally scalable websocket architecture, and per topic subscription authentication for WAMP v2.

Architecture
------------

[](#architecture)

Virge::Stork provides a scalable architecture that allows you to scale your websocket servers, and webservers independently, as well as support for load balancing of websocket servers.

Publish Server
--------------

[](#publish-server)

Virge::Stork provides a ZMQ Publish server. This server subscribes to all available Websocket Servers, and will broadcast every push notification to all websocket servers.

Websocket Client
----------------

[](#websocket-client)

The websocket client subscribes to the ZMQ Publish server, when receiving messages from the ZMQ Publish Server it broadcasts to all subscribed.

Authentication Client
---------------------

[](#authentication-client)

The Auth Client handles the authentication of clients, and their topic subscriptions.

Crossbar.io or other WAMP Router
--------------------------------

[](#crossbario-or-other-wamp-router)

Usage requires using crossbar.io or another compliant WAMP Router. Stork depends on a role that allows it to register two Procedures

io.virge.stork.auth Used to provide basic ticket authentication to clients

io.virge.stork.topic\_auth Used to determine if the client can subscribe to a given topic

Topics
------

[](#topics)

Topics are a URI that follows the format:

```
version.feedName.feedId

```

They are declared in Stork, and optionally attached to verifiers.

```
use Virge\Stork;
Stork::topic('v1', 'test')
    ->verify(function($session, $topic, $feedId, &$reason) {
        return true;
    })
;

```

The declared topics do not include the feedId, this is passed in by the client upon connection. It will be passed to the verifier and can be used in determining if the user can subscribe.

Authenticator
-------------

[](#authenticator)

Virge::Stork provides the ability to have a custom authenticator callback for initial websocket connection. This authenticator should set the authId to a valid string (usually the UserId of the user connection)

This authId will be used in the topic authentication

```
Stork::authenticator(function($session, &$returnData) {

    if($session->ticket === 'testtest') {
        $returnData['authid'] = "1";
        return true;
    }

    return false;
});

```

RPC \*alpha
-----------

[](#rpc-alpha)

Virge::Stork provides the ability to register and call RPC methods. You start with a MethodController that will then register available RPC methods.

Checkout examples/simple/rpc\_caller.php and rpc\_provider.php for an example.

Running Examples
----------------

[](#running-examples)

From within examples/simple you'll need to start 3 processes:

```
php -f publish_server.php

```

```
php -f ws_client.php

```

```
php -f auth_client.php

```

You will also need to start a crossbar.io server, an example configuration is provided within examples/simple:

```
docker run --name crossbar -p 8000:80 -e "CROSSBAR_BACKEND_SECRET=testtest" -v /abs/path/to/examples/simple/.crossbar:/app/.crossbar --entrypoint "crossbar start --cbdir /app/.crossbar" crossbario/crossbar

```

We can also start our webserver within that directory:

```
php -S localhost:9000

```

Editing services.php will allow you to configure ports, and hostnames.

You should be able to visit  and it should attempt to connect to the websocket. Opening up the console will show debug information, and any connection errors.

You can then send push messages using:

```
php -f push.php

```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity74

Established project with proven stability

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

Recently: every ~32 days

Total

33

Last Release

2868d ago

Major Versions

v2.8.0 → v3.0.02018-02-27

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ea92aa37370c3f24c124136ad9ec85883ee1d3fb38302dcf41d7d47d26bee69?d=identicon)[siosphere](/maintainers/siosphere)

---

Top Contributors

[![siosphere](https://avatars.githubusercontent.com/u/2582612?v=4)](https://github.com/siosphere "siosphere (14 commits)")

### Embed Badge

![Health badge](/badges/virge-stork/health.svg)

```
[![Health](https://phpackages.com/badges/virge-stork/health.svg)](https://phpackages.com/packages/virge-stork)
```

###  Alternatives

[voryx/thruway-bundle

WebSockets (WAMP2) integration for Symfony2

98120.8k](/packages/voryx-thruway-bundle)[askedio/laravel-ratchet

A Ratchet Server built for Laravel

18728.2k2](/packages/askedio-laravel-ratchet)[xibosignage/xibo-xmr

Xibo Message Relay

1011.5k](/packages/xibosignage-xibo-xmr)[rabrennie/jupyter-php-kernel

PHP Kernel for Jupyter Notebooks

321.1k](/packages/rabrennie-jupyter-php-kernel)[redbaron76/larapush

a Ratchet and ZMQ implementation for Laravel 4

251.0k](/packages/redbaron76-larapush)[denpa/laravel-zeromq

ZeroMQ driver for Laravel

171.1k](/packages/denpa-laravel-zeromq)

PHPackages © 2026

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