Created
July 7, 2017 08:41
-
-
Save dos65/60f2ec31fff084b5ab1b8b3fa6ac760d to your computer and use it in GitHub Desktop.
ws
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
function runWs() { | |
var socket = new WebSocket("ws://localhost:2004/v2/api/jobs/ws"); | |
socket.onopen = function() { | |
console.log("Connected!") | |
socket.send("HELLO!") | |
}; | |
socket.onmessage = function(event) { | |
console.log(event.data); | |
}; | |
socket.onclose = function(event) { | |
console.log("CLosed") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment