Answer the question
In order to leave comments, you need to log in
How to get a common handshake between different namespaces in socket.io?
During the application, the same client connects to the server using different namespaces.
var nsp = io.of('/my-namespace');
nsp.use(function (client, next){
client.handshake.userId = 1;
next();
});
var nsp2 = io.of('/my-tho');
nsp2.use(function (client, next){
console.log(client.handshake.userId); // - > undefined
next();
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question