Find file Copy path
d8c5887 May 6, 2018
1 contributor

Users who have contributed to this file

executable file 20 lines (13 sloc) 415 Bytes
#!/usr/bin/env python
# WS client example
import asyncio
import websockets
async def hello():
async with websockets.connect(
'ws://localhost:8765') as websocket:
name = input("What's your name? ")
await websocket.send(name)
print(f"> {name}")
greeting = await websocket.recv()
print(f"< {greeting}")