0

I'm trying to create a server app in node.js, where multiple clients connect, and then one sends data, and that data gets send to another specific client. Which client it gets sent to is determined by a 'user id' that all clients will send after they connect.

How can I keep track of clients as they connect? How can I find my specific client? I realize this is a very broad question, but any pointers would be appreciated...

Thanks!

1 Answer 1

1

Have a look at some of the existing open source node servers like Socket.IO.

Socket.IO basically assigns each client a unique id. Ids are stored in a hash which is then used as a lookup to identify specific clients - you can create channels as well as broadcast to all connected clients.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.