我遇到了与这个问题websockets "scheme https is invalid" 类似的问题,但我实际上是在尝试使用 https 问题是我收到了连接指令以从服务器获取数据,并且在该文档中,他给了我列表要连接的服务器。不幸的是,它是https://theirserverurl.com的列表,而不是像往常一样的 wss://。我试图通过以下方式向其中一台服务器打招呼:
from websocket import create_connection
ws = create_connection("https://theirserverurl.com")
print ("Sending 'Hello, World'...")
ws.send("Hello, World")
print ("Sent")
print ("Reeiving...")
result = ws.recv()
print ("Received '%s'" % result)
ws.close()
我得到的错误是:
ValueError: scheme https is invalid
有什么解决方案可以在 python 上克服这个堆栈。请帮助我。谢谢!