AI-Colab / temp_client_test.py
A.Tuin
Out_2026_04_08
61898fa
Raw History Blame Contribute Delete
444 Bytes
import asyncio
import websockets
import json
async def test_ws_client():
uri = "ws://127.0.0.1:5005/ws/echo"
try:
async with websockets.connect(uri) as ws:
print('Connected to echo WS')
await ws.send(json.dumps({"test": 1}))
print('Received:', await ws.recv())
except Exception as e:
print(f'Error during test: {e}')
if __name__ == '__main__':
asyncio.run(test_ws_client())