Skip to content

Instantly share code, notes, and snippets.

@limarc
Created September 24, 2015 07:54
Show Gist options
  • Select an option

  • Save limarc/7f5fffaf6fc577fc4281 to your computer and use it in GitHub Desktop.

Select an option

Save limarc/7f5fffaf6fc577fc4281 to your computer and use it in GitHub Desktop.
var ws = new WebSocket('ws://echo.websocket.org');
ws.addEventListener('open', function(e) {
console.log('CONNECTED', e);
});
ws.addEventListener('message', function(e) {
console.log('RESPONSE', e);
});
ws.addEventListener('error', function(e) {
console.log('ERROR', e);
});
// ws.send('Hello');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment