准备实现一个简单的登录验证,在onConnect方法里面获取当前连接的query参数以验证,有什么办法可以获取么?,比如socket.io请求过来是这样的 ws://127.0.0.1:9534/?token=owv4I5mDwuBmleSBjnz2 如何获取这个token呢?
http://doc.workerman.net/appendices/about-websocket.html
$ws = new Worker('websocket://0.0.0.0:8181'); $connection->onWebSocketConnect = function($connection , $http_header) { echo $_GET['token ']; };
好的,收到了,谢谢
http://doc.workerman.net/appendices/about-websocket.html
好的,收到了,谢谢