Created
March 12, 2019 17:57
-
-
Save mattes/6c0bc186a7f013482d2b2d1c67a485ed to your computer and use it in GitHub Desktop.
This file contains 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
ws = new WebSocket("ws://localhost:8080"); | |
ws.onopen = function(evt) { | |
console.log("OPEN"); | |
} | |
ws.onclose = function(evt) { | |
console.log("CLOSE"); | |
ws = null; | |
} | |
ws.onmessage = function(evt) { | |
console.log("RESPONSE: " + evt.data); | |
} | |
ws.onerror = function(evt) { | |
console.log("ERROR: " + evt.data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment