/vendor/channel-master/src/Client.php';
// 初始化一个Channel服务端
$channel_server = new Channel\Server('0.0.0.0', 2206);
// websocket服务端
$worker = new Worker('websocket://0.0.0.0:4236');
$worker->count = 2;
$worker->name = 'pusher';
$worker->onWorkerStart = function ($worker) {
// Channel客户端连接到Channel服务端
Channel\Client::connect('127.0.0.1', 2206);
// 以自己的进程id为事件名称
$event_name = $worker->id;
// 订阅worker->id事件并注册事件处理函数
Channel\Client::on($event_name, function ($event_data) use ($worker) {
$to_connection_id