diff --git a/docs/client.html b/docs/client.html index 7208036..d267e89 100644 --- a/docs/client.html +++ b/docs/client.html @@ -4,7 +4,7 @@ + + + \ No newline at end of file diff --git a/docs/receive.html b/docs/receive.html new file mode 100644 index 0000000..f2e7462 --- /dev/null +++ b/docs/receive.html @@ -0,0 +1,43 @@ + + +
+ + + + \ No newline at end of file diff --git a/test.py b/test.py index 3a0c63c..f31e4ae 100644 --- a/test.py +++ b/test.py @@ -14,14 +14,14 @@ async def handshake(ws,j): async def set_variable(j): for name,ws in clients.get(j.get('project_id'),{}).items(): print(f"> {name} - {json.dumps(j)}") - ws.send(json.dumps(j)) + await ws.send(json.dumps(j)) async def disconnect(project_id,user): print("disconnecting",user) clients.get(project_id,[]).pop(user) -async def hello(websocket, path): +async def process(websocket, path): project_id = "" user = "" async for data in websocket: @@ -36,7 +36,6 @@ async def hello(websocket, path): pass await disconnect(project_id,user) -start_server = websockets.serve(hello, 'localhost', 5000) - +start_server = websockets.serve(process, 'localhost', 5000, compression=None) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() \ No newline at end of file