Html 为什么使用ssl时会出现连接问题?
我正在我的网站上运行一个聊天应用程序,当我使用HTTP时,一切正常,但当我添加SSL并开始使用HTTPS时,我的websocket连接出现以下错误:Html 为什么使用ssl时会出现连接问题?,html,ssl,websocket,phpwebsocket,Html,Ssl,Websocket,Phpwebsocket,我正在我的网站上运行一个聊天应用程序,当我使用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. web
[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连接?可能在html文件中有一个指向包含http而非https的脚本的链接 例如:
应该是:
“为什么使用ssl时会出现连接问题?”-您有配置问题。我们可以查看服务器的URL是什么?在我的WebSocket.js文件中,我有一个。connection=new WebSocket('wss://localhost:815/');