22 lines
672 B
Python
22 lines
672 B
Python
#!/usr/bin/env python3
|
|
"""Test: bare minimum — connect and send hello."""
|
|
import asyncio, json, websockets
|
|
|
|
async def test():
|
|
uri = "wss://proxy.kube5s.ru/ws"
|
|
print(f"Connecting to {uri}...")
|
|
try:
|
|
async with websockets.connect(uri) as ws:
|
|
print("Connected!")
|
|
await ws.send(json.dumps({"c": -1}))
|
|
print("Sent empty final, waiting...")
|
|
try:
|
|
resp = await asyncio.wait_for(ws.recv(), timeout=15)
|
|
print(f"Response: {resp}")
|
|
except asyncio.TimeoutError:
|
|
print("TIMEOUT")
|
|
except Exception as e:
|
|
print(f"ERROR: {e}")
|
|
|
|
asyncio.run(test())
|