Veeru A S Veeru A S - 1 year ago 94
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;

Answer Source

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

socket.myappsuperuserid = user.userId;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download