socket.io-php-emitter
socket.io-php-emitter copied to clipboard
Sending token (for JWT) to socket.io server
Is it possible to add a query parameter when connecting to a socket.io server, so that client can be authenticated (via JWT)?
In a javascript client, it is as easy as:
var socket = io.connect('http://localhost:9000', {
'query': 'token=' + your_jwt
});
But you are not connecting directly with that lib to socket.io, it's only sending "messages" trough redis serwer. There is no need for such tokens, you just need redis serwer which will be a bridge between socket.io server and other emitters.