diff options
Diffstat (limited to 'resources/external/client_ws_test.py')
| -rw-r--r-- | resources/external/client_ws_test.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/resources/external/client_ws_test.py b/resources/external/client_ws_test.py new file mode 100644 index 0000000..9bf5a52 --- /dev/null +++ b/resources/external/client_ws_test.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +"""Client using the asyncio API.""" + +import asyncio +from websockets.asyncio.client import connect + + +async def hello(): + async with connect("wss://echo.websocket.org", subprotocols=["lws-mirror-protocol"]) as websocket: + await websocket.send("Hello world!") + message = await websocket.recv() + print(message) + + +if __name__ == "__main__": + asyncio.run(hello())
\ No newline at end of file |
