I would like to send a custom query variable during initial connect by sails.io on client. I added
io.sails.query = "token=fdbfdsjf";
after including the sails.io.js but I don't see it in the handshake data on server, which was:
query:
{ __sails_io_sdk_version: '0.11.0',
__sails_io_sdk_platform: 'browser',
__sails_io_sdk_language: 'javascript',
EIO: '3',
transport: 'polling',
t: '1432569655670-22' }
What is the proper way to add data/variable to handshake on client before sails.io connects to server?
I intercepted the window.io() function call to inject my query parameter to the .query property of the options object (second param to .io())