kanata-php / socket-conveyor
A WebSocket/Socket message Router
Fund package maintenance!
Requires
- php: ^8.2
- ext-openswoole: ^22.0|^22.1
- league/pipeline: ^1.0
- lotharthesavior/hook: ^0.0.1
- symfony/event-dispatcher: ^7.0
- symfony/workflow: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.41
- kanata-php/conveyor-server-client: ^0.1.0
- mockery/mockery: ^1.4
- openswoole/core: ^22.1
- openswoole/ide-helper: ^22.0
- phpro/grumphp: ^2.3
- phpstan/phpstan: ^1.10
- phpunit/phpunit: ^9.2
- squizlabs/php_codesniffer: ^3.7
- symfony/var-dumper: ^6.1
- dev-master
- 3.0.1-beta
- 3.0.0-beta
- 2.5.0
- 2.4.4
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.9
- 2.0.8
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.0
- 1.4.0
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.2.5
- 0.2.4
- 0.2.3
- 0.2.2
- 0.2.1
- 0.2.0
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- 0.0.1
- dev-feature/pusher-support
This package is auto-updated.
Last update: 2026-06-07 23:38:02 UTC
README
This package enables PHP 8.2+ applications to work with WebSocket messages
using a routing strategy. Add an action handler implementing ActionInterface
to the SocketMessageRouter, or run Conveyor in Pusher/Reverb-compatible mode
for Laravel Echo clients.
Socket Conveyor is built on OpenSwoole. You can find out more about using WebSockets with OpenSwoole here.
Built for PHP 8.2+.
Documentation
- Complete usage guide: installation, native Conveyor mode, Pusher/Reverb-compatible mode, Laravel Echo setup, HTTP endpoints, smoke testing, and troubleshooting.
- Laravel Echo / Reverb compatibility guide:
the shortest path for using Conveyor with Laravel's built-in
reverborpusherbroadcaster. - Real Pusher client smoke example: local
browser smoke test using
pusher-jsand Laravel Echo. - Project documentation site.
Using Conveyor as a Pusher/Reverb server
Conveyor can run in a Pusher-compatible mode for Laravel's stock pusher or
reverb broadcaster and the standard pusher-js / Laravel Echo client.
use Conveyor\Constants; use Conveyor\ConveyorServer; (new ConveyorServer()) ->port(8080) ->conveyorOptions([ Constants::WEBSOCKET_SUBPROTOCOL => Constants::PUSHER, Constants::USE_PRESENCE => true, Constants::APPS => [[ 'app_id' => 'local', 'key' => env('REVERB_APP_KEY'), 'secret' => env('REVERB_APP_SECRET'), 'enable_client_messages' => true, 'enabled' => true, ]], ]) ->start();
Point Laravel at the Conveyor host and port with the normal Reverb/Pusher env values:
BROADCAST_CONNECTION=reverb REVERB_APP_ID=local REVERB_APP_KEY=your-app-key REVERB_APP_SECRET=your-app-secret REVERB_HOST=127.0.0.1 REVERB_PORT=8080 REVERB_SCHEME=http
The Pusher mode accepts WebSocket clients at /app/{key} and exposes the
signed REST publish API at /apps/{app_id}/events,
/apps/{app_id}/batch_events, and the channel info endpoints under
/apps/{app_id}/channels.