No Description

NIX Worker db953022c0 Making websocket server not wait for jobs to complete, allowing new jobs to be started while the old ones are still running 2 years ago
serviceScripts daf6730c4d Correcting array iteration in bash 2 years ago
README.md 017d7ad233 Update 'README.md' 2 years ago
requirements.txt 2fcd1f749d Add 'requirements.txt' 2 years ago
send.py 52421a18ee Adding support for message to including calling server 3 years ago
websocketServer.py db953022c0 Making websocket server not wait for jobs to complete, allowing new jobs to be started while the old ones are still running 2 years ago

README.md

Installation

After cloning, virtual environment with python3 needs to be created.

Create virtual environment with python3 and requirements file:

virtualenv ~/venv/socket -p python3
source ~/venv/socket/bin/activate
pip install -r requirements.txt

Update serviceScripts/env.sh to point to correct IPs. For a server, IP is available as

ip add show

Select the ip with interface that has the highest probability that it points to a physical interface. In most systems this is eth0.

Run open_port.sh to modify firewall to accept connection on the designated port.

Run start.sh to start the server. Look for output/log at $HOME/logs/socketServer.log.

Debugging

Testing

~/software/venv/socket/bin/python send.py server:TEST:1

Open port

To check whether packets from client reach the host, use

sudo tcpdump -i enp68s0 'tcp port 8000' -v

This prints traffic to port 8000, say. Also helpful for determining actual IP address of the request; sometimes the actual source is behind a firewall and the IP could be mangled.

This address should be added to the $IPCLIENT address list in env.sh for open_port.sh to allow connections.

Allowed origins

Websockets further limits allowed connections to clients listed in websocketServer.py. The origin is part of the send.py makeup - adjust it so that websocketServer.py will take it as trustworthy.

The error associated with mis-configuration is

websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 403