python websocket模拟客户

2023-01-31 03:01:00 python 客户 模拟
##注意要安装 pip install websocket-client
from WEBSocket import create_connection
ws = create_connection("ws://127.0.0.1:9002")
ws.send("Hello, World")##发送消息
result = ws.recv()##接收消息
ws.close()

相关文章