不安全的WebSocket连接可能无法从通过HTTPS加载的页面启动

Mercury

问题描述

Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS

使用https是出现这个错误 尝试了把ws改成wss报错没有了但还是链接不上

程序代码

        //链接WorkerMan
        ws = new WebSocket('ws://IP:7272/ws');

报错信息

Mixed Content: The page at 'https://域名' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://ip:7272/ws'. This request has been blocked; this endpoint must be available over WSS.

Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS

截图报错信息里报错文件相关代码

截图

操作系统及workerman/webman等框架组件具体版本

workerman 4.1.10

4783 0 0
0个回答

年代过于久远,无法发表回答
×
🔝