Websocket connection, w bi-directional transport complete

This commit is contained in:
Raelon Masters
2020-08-09 18:33:20 -04:00
parent fcfb347fbf
commit 6f06796cba
2 changed files with 12 additions and 10 deletions

View File

@@ -21,9 +21,12 @@ async def echo(websocket, path):
tx = pong(message)
await websocket.send(tx)
def pong(message):
print('Ping Received')
return "pong"
start_server = websockets.serve(echo, "127.0.0.1", 1337)
asyncio.get_event_loop().run_until_complete(start_server)