I am trying to make a logged in user to join a certain socket.io room on connect. According to any examples I found on the net I seem to have emit some action from client to be
This should be what you need. Feel free to pass in whatever room name you want through the client. Only the server can handle assigning a socket to a room.
Server:
io.sockets.on('connection', function(socket) {
socket.on('join', function(room) {
socket.join(room);
});
});
Client:
socket.emit('join', roomNum);