Skip to content

Instantly share code, notes, and snippets.

@Srushtika
Created November 16, 2018 14:38
Show Gist options
  • Save Srushtika/d4f1feb8652d8b97219e18b17081873d to your computer and use it in GitHub Desktop.
Save Srushtika/d4f1feb8652d8b97219e18b17081873d to your computer and use it in GitHub Desktop.
WebSockets server tutorial
ws.addEventListener('message', event => {
// The `event` object is a typical DOM event object, and the message data sent
// by the server is stored in the `data` property
console.log('Received:', event.data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment