socket.on('newMessage', (messageObj) => {
if (roomNumber === messageObj.roomNumber) {
console.log("message received:" + messageObj.message);
$('#messages').append($('<li>').text(messageObj.userName + ' : ' + messageObj.message));
}
});
socket.in wasn't behaving as advertised (broadcasting to all rooms). I decided to take matters into my own hands.