【发布时间】:2018-04-17 07:50:57
【问题描述】:
正如标题所述,我无法从通过 HTTPS 提供服务的网站连接到 deepstream 服务器。不过我可以通过本地服务器连接它。
最初我收到以下错误:
deepstream.min.js:3 Mixed Content: The page at 'https://example.com' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://<deepstream-domain>:6020/deepstream'. This request has been blocked; this endpoint must be available over WSS.
收到此错误后,我将连接字符串更改为wss://<deepstream-domain>。
但这会引发以下错误:
WebSocket connection to 'wss://<deepstream-domain>:6020/deepstream' failed: Error in connection establishment: net::ERR_CONNECTION_CLOSED
{"isTrusted":true}
知道如何解决这个问题吗?我是否也必须在 deepstream 服务器中设置 SSL 证书?
【问题讨论】:
-
example.com在 nginx 上还是什么?您应该通过相同的路由它然后它会工作。您将在服务器端终止 SSL 并将其转发到<deepstream-domain>:6020
标签: websocket socket.io deepstream.io