Veeru A S Veeru A S - 2 months ago 11x
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;