if ($channel_type !== 'private' && $channel_type !== 'presence') {
// {"event":"pusher:error","data":{"code":null,"message":"Client event rejected - only supported on private and presence channels"}}
return$connection->send($this->error(null, 'Client event rejected - only supported on private and presence channels'));
}
// 当前链接没有订阅这个channel
if (!isset($connection->channels[$channel])) {
return$connection->send($this->error(null, 'Client event rejected - you didn\'t subscribe this channel'));
}
// 事件必须以client-为前缀
if (strpos($event, 'client-') !== 0) {
return$connection->send($this->error(null, 'Client event rejected - client events must be prefixed by \'client-\''));
}
// @todo 检查是否设置了可前端发布事件
// {"event":"pusher:error","data":{"code":null,"message":"To send client events, you must enable this feature in the Settings page of your dashboard."}}
* POST /apps/1024/events?auth_key=b054014693241bcd9c26&auth_signature=ed7f5b604e6bbd21a888a861ed536a430a9d5e4df210937a241a811bd17fcf97&auth_timestamp=1487428415&auth_version=1.0&body_md5=15d251b35306a6da7efa515a0e971f80 HTTP/1.1
* GET /apps/1024/channels/my-channel?auth_key=b054014693241bcd9c26&auth_signature=5226650be00a064b417d50d49229e42bbb918e969c42e63aaa63b9d1c6cf9803&auth_timestamp=1489898340&auth_version=1.0
*
* GET /apps/1024/channels/presence-channel?auth_key=b054014693241bcd9c26&auth_signature=d46281bf69ccadfe9da270176c85daa88d4b9da55b1f3c2570d48fa1236f0b2c&auth_timestamp=1489903433&auth_version=1.0&info=subscription_count,user_count
*
* GET /apps/1024/channels/presence-channel/users?auth_key=b054014693241bcd9c26&auth_signature=2eee0ca6292e17b00484bdcb0bba686a47e8a7365a1b190248946182fc926309&auth_timestamp=1489904560&auth_version=1.0