Skip to content

Instantly share code, notes, and snippets.

@MSakamaki
Created February 23, 2015 02:42
Show Gist options
  • Save MSakamaki/6c92c50b2ac7cd285bfb to your computer and use it in GitHub Desktop.
Save MSakamaki/6c92c50b2ac7cd285bfb to your computer and use it in GitHub Desktop.
WebSocket Test
var wsx = new WebSocket('ws://' + location.host);
wsx.onopen = function(e){console.log('onopen',e);};
wsx.onmessage = function(e){console.log('onmessage',e)};
wsx.onclose = function(e){console.log('onclose',e)};
wsx.onerror = function(e){console.log('onerror',e)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment