Anyways in 0.7 we introduced the `handshake` property, this property contains all data that we gathered during the initial handshaking with the server (stuff as headers, and ip etc is stored). You can read more about it here: https://github.com/LearnBoost/socket.io/wiki/Authorizing
As for sending params to the server, in 0.7.8 we added support for query strings in the connection url. So you can do:
io.connect('http://localhost:8080?pewpew=pew');
and you can than read it out during authorization and in handshake;
var io = require(socket.io).listen(8080)
io.sockets.on(connection, function (socket) {
.. bla bla
console.log(socket.handshake.query.pewpew) // => pew
});
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
> As for sending params to the server, in 0.7.8 we added support for query
strings in the connection url. So you
> can do:
>
> io.connect('http://localhost:8080?pewpew=pew');
>
> and you can than read it out during authorization and in handshake;
>
I've got that working, but it appears to me that those query strings are sent in
every subsequent get. (long-polling)
I'm sending ~ 200 characters for my initial authorization (granted, I could
probably cut that in half) and I'm seeing it on every request after that. Is
there a way to change / remove those parameters after the handshake has finished?