我在我的网站上运行一个聊天应用程序,当我使用 HTTP 时一切正常,但是一旦我添加了 SSL 并开始使用 HTTPS,我的 websocket 连接就会出现以下错误:
[blocked] The page at 'https://localhost/test/' was loaded over HTTPS, but ran insecure content from 'ws://localhost:815/': this content should also be loaded over HTTPS.
websocket.js:10
Uncaught SecurityError: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
我尝试将 ws 更改为 wss 并删除这些错误,但该聊天仍然无法正常工作。
我使用 Godaddy 作为我的主机/服务器提供商。我是否需要更新 SSL 证书以告诉它以某种方式批准 wss 连接?