From 7145e0323efd082d4b4ec8b38a5b1bd51073d2f3 Mon Sep 17 00:00:00 2001 From: Charlie Date: Sun, 17 Mar 2024 18:22:56 +1100 Subject: [PATCH] ws.py --- ws.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 ws.py diff --git a/ws.py b/ws.py new file mode 100644 index 0000000..0d4d55f --- /dev/null +++ b/ws.py @@ -0,0 +1,13 @@ +import asyncio +import websockets + + +async def test_link(): + async with websockets.connect('ws://localhost:5000/') as websocket: + for i in range(50): + print(f"Sending message {i}") + await websocket.send("SCRAM") + + +asyncio.get_event_loop().run_until_complete(test_link()) +asyncio.get_event_loop().run_forever()