Answer the question
In order to leave comments, you need to log in
Why is the modified handshake not being sent?
io.set('authorization', function (handshake, accept) {
///.......
handshake.user='some string';
accept(null, true);
});
io.on('connection', function(socket){
console.log('a user connected');
console.log(socket.handshake.user);
// .......
});
a user connected
undefined
Answer the question
In order to leave comments, you need to log in
I don’t remember exactly, but it seems I did it through io.use and not io.set
Hooray. You need to knock on the object like this
io.on('connection', function(socket){
console.log('a user connected');
console.log(socket.request.user);
// .......
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question