Files
StingNET/websocket-test.py

19 lines
366 B
Python

#!/usr/bin/env python
from websockets.sync.client import connect
def hello():
uri = "ws://localhost:30341"
with connect(uri) as ws:
while True:
greeting = ws.recv()
print(f"<<< {greeting}")
cmd = input(">>> ")
ws.send(cmd)
# print(f">>> {name}")
if __name__ == "__main__":
hello()