SHA256
27 lines
420 B
Python
27 lines
420 B
Python
import time
|
|
|
|
from websocket import create_connection
|
|
|
|
ws = create_connection("ws://192.168.0.220:81")
|
|
i = 0
|
|
print("Conectado")
|
|
|
|
try:
|
|
while True:
|
|
data = ws.recv()
|
|
i += 1
|
|
|
|
if isinstance(data, bytes):
|
|
print(f"BIN: {list(data)}")
|
|
|
|
else:
|
|
print(f"TXT: {data}")
|
|
|
|
print(f"DEBUG {i}")
|
|
|
|
|
|
except KeyboardInterrupt:
|
|
print("Cerrando conexión")
|
|
|
|
ws.close()
|