wsclient reconnects automatically

closes #6
This commit is contained in:
boyska 2022-08-17 22:10:17 +02:00
parent dcea0ce37d
commit c2abb5ba31
2 changed files with 5 additions and 1 deletions

View file

@ -30,6 +30,7 @@ a questo punto lancia `docker-compose up`
### GUI
```
apt install python3-websocket
./utils/wsclient.py -k 'wss://localhost:8000/v1/ws/counter/0' | stdbuf -o0 jq .value | ./schermetto/num_display.py --no-fu --inve 4
```

View file

@ -1,6 +1,7 @@
#!/usr/bin/python3 -u
import argparse
import ssl
import time
import websocket
@ -34,7 +35,9 @@ def main():
run_opts = {}
if not args.ssl_verify:
run_opts = {"sslopt": {"cert_reqs": ssl.CERT_NONE}}
while True:
wsapp.run_forever(**run_opts)
time.sleep(1)
if __name__ == "__main__":