In socket.io, you usually use a specific syntax on the server side if you want to send a message to a specific room: io.to(room).emit('event', 'message');
.
But how would a client (what I mean is the socket.io-related code running in a browser) indicate that a message should go to a specific room?
Is it common to just create something like this (of course the server has to evaluate it):
socket.emit('chat message', {room: 'abc', msg: 'hello there'});
Or does the socket.io client-side library offer a specific syntax for this purpose as well?
edit: to clarify, my suggestion from above seems to work, I'm just not sure if there's a better solution.