我被Firefox搞砸了.我无法使Websocket工作.我使用Tornado Websocket并通过以下代码初始化它:
app = Application([(r'/mypath/ws', WSHandler)])
http_server = HTTPServer(app, ssl_options={
"certfile": "~/certs/websocket.crt",
"keyfile": "~/certs/websocket.key"
})
http_server.listen("443")
Run Code Online (Sandbox Code Playgroud)
我在Javascript端初始化它像这样:
var WS = new WebSocket("wss://websocket.localhost/mypath/ws");
Run Code Online (Sandbox Code Playgroud)
此代码在Chrome上运行正常,同时我自己创建了证书并在HTTPS下运行该页面.但Firefox一直这样说:
Firefox can't establish a connection to the server at wss://websocket.localhost/mypath/ws.
Run Code Online (Sandbox Code Playgroud)
我谷歌它,发现太多的想法,但没有'''为我工作:(
任何帮助将不胜感激.