diff options
| author | Anson Bridges <bridges.anson@gmail.com> | 2025-08-11 22:42:00 -0700 |
|---|---|---|
| committer | Anson Bridges <bridges.anson@gmail.com> | 2025-08-11 22:42:00 -0700 |
| commit | d558a9add0e183219a7a9ff482807bdcd677e21a (patch) | |
| tree | 49e454649a4b45ce02c419894109de55f7f2e465 /resources/external/client_ws_test.py | |
Initialize repo from local files
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 |
