Last active
December 22, 2015 07:29
-
-
Save c7tincu/ac8ccfc190fde7547ec4 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
WebSocket.prototype.oldSendImpl = WebSocket.prototype.send; | |
WebSocket.prototype.send = | |
function (data) { | |
console.log("\u2192 " + data); | |
this.oldSendImpl(data); | |
this.addEventListener( | |
"message", | |
function (msg) { | |
console.log("\u2190 " + msg.data); | |
}, | |
false | |
); | |
this.send = | |
function (data) { | |
this.oldSendImpl(data); | |
console.log("\u2192 " + data); | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don’t use this in a production environment… ☺