Example how to use websockets Server runs on port 4001 To connect from Chrome, you need to run the following commands through the console let socket = new WebSocket("ws://localhost:4001/order") socket.onmessage = (event) => {console.log("received from the server: ", event.data)} simple example of broadcasting message let socket = new WebSocket("ws://localhost:4001/ws") socket.send("hi")