python websocket模拟客户端

##注意要安装 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()

猜你喜欢

转载自blog.csdn.net/caobin0825/article/details/80325709
今日推荐