0

I don't know how to get options from socket client connection.

Client:

var socketURL = 'http://127.0.0.1:3000';

var options = {
    transports: ['websocket'],
    'force new connection': true,
    query: 'token=jnecdodcswoimedwmnoinsdxc'
};

Server:

sio.on('connection', function(socket){
    console.log(socket.query) // this not working
}

Thanks

Ali Amini
  • 172
  • 2
  • 14
  • I want get `query` option from client-side for token. – Ali Amini Aug 02 '16 at 04:57
  • I discovered how you can do it and it's all described in the question/answer I marked yours a duplicate of. It is unfortunate that the socket.io documentation is so lacking in this type of information. – jfriend00 Aug 02 '16 at 05:06

0 Answers0