python实现的WebSocket客户端
·
转自 https://blog.csdn.net/qq562029186/article/details/81203893
安装
sudo pip install websocket-client
- 1
示例客户端代码:
#!/usr/bin/python
from websocket import create_connection
ws = create_connection("ws://localhost:8080/websocket")
print "Sending 'Hello, World'..."
ws.send("Hello, World")
print "Sent"
print "Reeiving..."
result = ws.recv()
print "Received '%s'" % result
ws.close()更多推荐



所有评论(0)