Created
September 25, 2016 00:08
-
-
Save homerquan/acf71533fa31e7cc55f33b8e36bd1a21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = io.connect(socketURL, options); | |
client.on('connect', function(data) { | |
console.log("client receive connect" + data); | |
}); | |
client.on('connect_confirm', function(data) { | |
console.log('confirm'); | |
}); | |
//for debug on all events | |
var onevent = client.onevent; | |
client.onevent = function (packet) { | |
var args = packet.data || []; | |
onevent.call (this, packet); // original call | |
packet.data = ["*"].concat(args); | |
onevent.call(this, packet); // additional call to catch-all | |
}; | |
client.on('*', function(event, data) { | |
console.log(event); | |
console.log(data); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment