Websocket server that handles multiple client connections and relays each message received to every other client.
Multiple clients can connect to this WebSockets server. Whenever a message is sent to the server by a client, every other client gets the message. Relay.
npm install -g wsrelayThe default port used is 8124, although you can pass a port number as an argument.
wsrelay [port]You can test the server out using wscat, which is like the UNIX cat command but for websockets.
wscat --connect ws://localhost:8124Be sure to connect two wscats to the server to see it relaying messages.
Alternatively, you can write your own websocket client in Javascript
var WebSocket = ;var ws = 'ws://localhost:8124'; //print out all relay messages received ws { var message = evtdata; console;} //send all user input to the relay processstdin;