Download the PHP package roadrunner-php/centrifugo without Composer
On this page you can find all versions of the php package roadrunner-php/centrifugo. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download roadrunner-php/centrifugo
More information about roadrunner-php/centrifugo
Files in roadrunner-php/centrifugo
Package centrifugo
Short Description RoadRunner: Centrifugo bridge
License MIT
Homepage https://roadrunner.dev/
Informations about the package centrifugo
RoadRunner Centrifugo Bridge
This repository contains the codebase PHP bridge using RoadRunner centrifuge plugin.
Installation
To install application server and Jobs codebase
You can use the convenient installer to download the latest available compatible version of RoadRunner assembly:
Proxy Centrifugo requests to a PHP application
It's possible to proxy some client connection events from Centrifugo to the RoadRunner application server and react to them in a custom way. For example, it's possible to authenticate connection via request from Centrifugo to application backend, refresh client sessions and answer to RPC calls sent by a client over bidirectional connection.
The list of events that can be proxied:
connect
– called when a client connects to Centrifugo, so it's possible to authenticate user, return custom data to a client, subscribe connection to several channels, attach meta information to the connection, and so on. Works for bidirectional and unidirectional transports.refresh
- called when a client session is going to expire, so it's possible to prolong it or just let it expire. Can also be used just as a periodical connection liveness callback from Centrifugo to app backend. Works for bidirectional and unidirectional transports.sub_refresh
- called when it's time to refresh the subscription. Centrifugo itself will ask your backend about subscription validity instead of subscription refresh workflow on the client-side.subscribe
- called when clients try to subscribe on a channel, so it's possible to check permissions and return custom initial subscription data. Works for bidirectional transports only.publish
- called when a client tries to publish into a channel, so it's possible to check permissions and optionally modify publication data. Works for bidirectional transports only.rpc
- called when a client sends RPC, you can do whatever logic you need based on a client-provided RPC method and params. Works for bidirectional transports only.
First you need to add centrifuge
section to your RoadRunner configuration. For example, such a configuration
would be quite feasible to run:
and centrifugo config:
Note
proxy_connect_endpoint
,proxy_publish_endpoint
,proxy_subscribe_endpoint
,proxy_refresh_endpoint
,proxy_sub_refresh_endpoint
,proxy_rpc_endpoint
- endpoint address of roadrunner server with activatedcentrifuge
plugin.
To init abstract RoadRunner worker:
Note You can find addition information about here.
License
The MIT License (MIT). Please see LICENSE
for more information. Maintained
by Spiral Scout.
All versions of centrifugo with dependencies
ext-json Version *
roadrunner-php/roadrunner-api-dto Version ^1.0
spiral/goridge Version ^4.0
spiral/roadrunner-worker Version ^3.0
spiral/roadrunner Version ^2023.1 || ^2024.1
google/protobuf Version ^3.7 || ^4.0