【问题标题】:Unable to connect to deepstream server from website over HTTPS无法通过 HTTPS 从网站连接到深流服务器
【发布时间】: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 并将其转发到 &lt;deepstream-domain&gt;:6020

标签: websocket socket.io deepstream.io


【解决方案1】:

通过向域添加 SSL 证书并在 deepstream config.yml 文件中提供 SSL 密钥路径来解决问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-11-19
    • 1970-01-01
    • 2017-11-30
    • 1970-01-01
    • 1970-01-01
    • 2013-01-14
    • 2017-01-18
    • 1970-01-01
    相关资源
    最近更新 更多