rase- / socket.io-php-emitter

A PHP implementation of socket.io-emitter
MIT License
344 stars 65 forks source link

Sending token (for JWT) to socket.io server #22

Open frey1esm opened 8 years ago

frey1esm commented 8 years ago

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
});
aPoCoMiLogin commented 8 years ago

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.