Skip to content

Instantly share code, notes, and snippets.

@AlexDaSoul
Last active July 3, 2018 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaSoul/d9f77170b180b4009d0ee86db9ab3d84 to your computer and use it in GitHub Desktop.
Save AlexDaSoul/d9f77170b180b4009d0ee86db9ab3d84 to your computer and use it in GitHub Desktop.
ws-1
const ws = new WebSocket("ws://www.example.com/socketserver", "protocolOne");
ws.onopen = () => {
ws.onmessage = (event) => {
console.log(event);
}
ws.send("Here's some text that the server is urgently awaiting!");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment