我使用用于Python的websockets库获得此服务器代码,但我希望它仅将接收到以下消息的客户端发送给客户端:
import asyncio
import websockets
async def hello(websocket, path):
recv = await websocket.recv()
await websocket.send(recv)
start_server = websockets.serve(hello, "localhost", 8080)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()```