I'm using socket.io and passport.js to authenticate people with their Steam accounts. I want to be able to send data to specific Steam's ID. I'am alredy using
io.use(function(socket, next) {
session(socket.handshake, {}, next);
});
to access passport data of passport inside socket.io. I've thought of of storing active sockets in array, then just find one with a proper Steam ID. Is there some better solution?