socket.io-php-emitter icon indicating copy to clipboard operation
socket.io-php-emitter copied to clipboard

Sending token (for JWT) to socket.io server

Open frey1esm opened this issue 8 years ago • 1 comments

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
});

frey1esm avatar Mar 25 '16 11:03 frey1esm

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.

aPoCoMiLogin avatar Mar 29 '16 13:03 aPoCoMiLogin