From e37657351d8c731538803ea698498ca487a4ccc5 Mon Sep 17 00:00:00 2001 From: Wok Date: Wed, 15 Jun 2022 12:59:43 +0200 Subject: [PATCH] Add main script for SteamWebPipes --- run_SteamWebPipes.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 run_SteamWebPipes.py diff --git a/run_SteamWebPipes.py b/run_SteamWebPipes.py new file mode 100644 index 0000000..b25330e --- /dev/null +++ b/run_SteamWebPipes.py @@ -0,0 +1,19 @@ +import asyncio +import websockets + + +async def handler(websocket): + while True: + message = await websocket.recv() + print(message) + + +async def main(): + url = "ws://localhost:8181" + async with websockets.connect(url) as ws: + await handler(ws) + await asyncio.Future() # run forever + + +if __name__ == "__main__": + asyncio.run(main())