Runkit
Runkit
home page
user forum
new notebook
support & documentation
log in
sign up
new notebook
documentation & support
Sign In
Sign Up
jhasselbring's notebooks
WS
-
/jhasselbring/ws
Last edited 4 years ago
- from:
https://runkit.com/docs/endpoint
const WebSocket = require('ws'); const wss = new WebSocket.Server({ port: 3000 }); wss.on('connection', function connection(ws) { ws.on('message', function incoming(message) { console.log('received: %s', message); }); ws.send('something'); });