File size: 311 Bytes
61898fa
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import asyncio
import websockets

async def t():
    try:
        async with websockets.connect("ws://127.0.0.1:5000/ws/test") as ws:
            msg = await ws.recv()
            print(f"RECEIVED: {msg}")
    except Exception as e:
        print(f"ERROR: {e}")

if __name__ == '__main__':
    asyncio.run(t())