Veeru A S Veeru A S - 7 months ago 34
Node.js Question

can i give my own id to a connected socket in nodejs

am trying to implement a multiuser communication app. I want to identify a user's socket with his id, so can i set socket's id to user' id like;


You can do this, but use property that doesn't clash with Node.js or any other frameworks keys

socket.myappsuperuserid = user.userId;