I want to use express plus socket.io to implement a multi-room chat system. A user can have multiple groups. This group can be created at any time. It is identified by a unique id. After I log in, switching the corresponding group will require me to enter the corresponding channel and use it.
io.connect(/roomid)Send a connection request, then how does the server divide rooms here? Because the server doesn’t know this roomid yet, use
io.of(/roomid)It doesn’t seem feasible. Or can we use regular expressions here to receive? Hope to have some advice from relevant experience:)
It is suggested to look at the implementation of comtd.