parent
96b4fed18c
commit
16a05a4a31
@ -0,0 +1,15 @@
|
||||
import asyncio
|
||||
from websockets.server import serve
|
||||
|
||||
|
||||
async def handler(websocket):
|
||||
async for message in websocket:
|
||||
print('recv msg', message)
|
||||
# await websocket.recv(message)
|
||||
|
||||
|
||||
async def main():
|
||||
async with serve(handler, '0.0.0.0', 8765):
|
||||
await asyncio.Future() # run forever
|
||||
|
||||
asyncio.run(main())
|
@ -0,0 +1 @@
|
||||
websockets
|
Loading…
Reference in new issue