Skip to content

Instantly share code, notes, and snippets.

@dos65
Created July 7, 2017 08:41
Show Gist options
  • Save dos65/60f2ec31fff084b5ab1b8b3fa6ac760d to your computer and use it in GitHub Desktop.
Save dos65/60f2ec31fff084b5ab1b8b3fa6ac760d to your computer and use it in GitHub Desktop.
ws
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