Python Websocket-ConnectionRefusedError:[Errno 111]连接被拒绝

时间:2020-05-12 09:42:47

标签: python websocket

我实际上正在尝试通过localhost连接使用websocket hello世界示例。

from websocket import create_connection
ws = create_connection("wss://localhost:5000/websocket", timeout=5)
print ("Sending 'Hello, World'...")
ws.send("Hello, World")
print ("Sent")
print ("Receiving...")
result =  ws.recv()
print ("Received '%s'" % result)
ws.close()

我得到的错误是:

ConnectionRefusedError: [Errno 111] Connection refused

感谢您的提前帮助

0 个答案:

没有答案