(ws) Add a new ws sub-command, echo_client. This command send a message to an echo server, and send back to a server whatever message it does receive. When connecting to a local ws echo_server, on my MacBook Pro 2015 I can send/receive around 30,000 messages per second. (cf #235)

This commit is contained in:
Benjamin Sergeant
2020-08-02 12:09:13 -07:00
parent d719c41e31
commit bcae7f326d
9 changed files with 160 additions and 4 deletions

View File

@ -10,7 +10,7 @@ import websockets
async def echo(websocket, path):
while True:
msg = await websocket.recv()
print(f'Received {len(msg)} bytes')
# print(f'Received {len(msg)} bytes')
await websocket.send(msg)
host = os.getenv('BIND_HOST', 'localhost')