diff options
Diffstat (limited to 'tests/wpt/web-platform-tests/tools/third_party/websockets/example/hello.py')
-rwxr-xr-x | tests/wpt/web-platform-tests/tools/third_party/websockets/example/hello.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/wpt/web-platform-tests/tools/third_party/websockets/example/hello.py b/tests/wpt/web-platform-tests/tools/third_party/websockets/example/hello.py new file mode 100755 index 00000000000..6c9c839d827 --- /dev/null +++ b/tests/wpt/web-platform-tests/tools/third_party/websockets/example/hello.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import asyncio +import websockets + +async def hello(): + uri = "ws://localhost:8765" + async with websockets.connect(uri) as websocket: + await websocket.send("Hello world!") + await websocket.recv() + +asyncio.get_event_loop().run_until_complete(hello()) |