Categorizing Clients

- 1 answer

I'm working on a prototype application using and having some trouble understanding the best approach to categorizing sockets.

My application serves multiple customers and has two types of clients:

  • Agent client running client using Node.js
  • Web browser client running client in the browser

How can my server identify that a particular socket belongs to an agent of customer A versus an agent of customer B versus a web browser for customer C?

I read about namespaces and rooms but still a bit confused.



If identification doesn't require security, simply let clients send a special event indicating what type of agent/browser they're, upon connection. On the server-side, when that event is received, set the identifier into the respective socket object.

If identification require security, you can grab the user session via