ws-router routes incoming data to multiple clients
5.9K
Simple websocket server to route traffic from one host to another.
Fetch the image with
docker pull pfigs/ws-router
Start the container as
docker run -d --name ws-router -p 3000:3000 ws-router
Start by installing the necessary modules with::
npm install
There are two environment variables that you can define to change the server behavior, SERVE_AT and SERVE_HTTPS.
SERVE_AT : Port where https or http server will be located SERVE_HTTPS: Starts https server instead of http (requires key and ceritificate)
Launch the process by::
node app.js
The point of this simple server is to /push data to all the clients that have /subscribed to the service.
If you want to receive data, point each host to::
ws://<server_ip>:<server_port>/subscribe
For the host pushing data, send its messages to::
ws://<server_ip>:<server_port>/push
Messages arriving at /push will be forwarded to all clients.
Pedro Silva
Content type
Image
Digest
Size
42.7 MB
Last updated
about 7 years ago
docker pull pfigs/ws-router