summaryrefslogtreecommitdiff
path: root/resources/external/client_ws_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/external/client_ws_test.py')
-rw-r--r--resources/external/client_ws_test.py17
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