MenuIt is useful for socket.io custom messaging
This method allows you set custom socket listener before starting or joining a room.
connection.socketCustomEvent = 'abcdef';
connection.openOrJoin('roomid', function() {
connection.socket.on(connection.socketCustomEvent, function(message) {
alert(message);
});
connection.socket.emit(connection.socketCustomEvent, 'My userid is: ' + connection.userid);
});
Alternative API: setCustomSocketEvent