Quellcode durchsuchen

Merge branch 'master' of https://git0.fmf.uni-lj.si/studen/websocket

NIX Worker vor 2 Jahren
Ursprung
Commit
c1ded1f3a2
1 geänderte Dateien mit 30 neuen und 0 gelöschten Zeilen
  1. 30 0
      README.md

+ 30 - 0
README.md

@@ -20,3 +20,33 @@ Run `open_port.sh` to modify firewall to accept connection on the designated por
 
 Run `start.sh` to start the server. Look for output/log at `$HOME/logs/socketServer.log`.
 
+### Debugging
+
+#### Testing
+
+```bash
+~/software/venv/socket/bin/python send.py server:TEST:1
+```
+
+
+#### Open port
+
+To check whether packets from client reach the host, use 
+
+```bash
+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 
+
+```bash
+websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 403
+```