Skip to content

Instantly share code, notes, and snippets.

@Youka
Last active November 30, 2021 19:44
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 Youka/9f33ec37e29096a82f0c6ea806ae8328 to your computer and use it in GitHub Desktop.
Save Youka/9f33ec37e29096a82f0c6ea806ae8328 to your computer and use it in GitHub Desktop.
Websocket echo server
new (require('ws').Server)({port:8080}).on('connection',sock=>sock.on('message',data=>sock.send(String(data))))
@Youka
Copy link
Author

Youka commented Nov 30, 2021

Install NodeJS, call npm i ws && node . and connect to ws://localhost:8080 (f.e. by Weasel).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment