Skip to content

Instantly share code, notes, and snippets.

@chazcheadle
Created February 22, 2016 14:43
Show Gist options
  • Select an option

  • Save chazcheadle/7343e3a070bc31573b42 to your computer and use it in GitHub Desktop.

Select an option

Save chazcheadle/7343e3a070bc31573b42 to your computer and use it in GitHub Desktop.
websocket connection test
var ws = new WebSocket("ws://HOST");
// Display message to confirm a connection has been made.
ws.onopen = function() {
console.log('open');
};
ws.onmessage = function (packet) {
console.log(packet.data);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment