You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
329 B
16 lines
329 B
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())
|