我正在做一个Web应用程序,需要使用websockets,为此,我使用socket.io库, 在本地,一切正常,但是在使用Windows Server 2012上传到我的vps时,它不起作用 我收到以下错误
WebSocket connection to 'wss://mydomain:8082/socket.io/?EIO=3&transport=websocket' failed: WebSocket is closed before the connection is established.
WebSocket connection to 'wss://mydomain:8082/socket.io/?EIO=3&transport=websocket' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT
因此我从Windows防火墙打开了端口8082,但是此端口用于协议通信 http,并且根据socket.io库,我需要通过https协议进行通信
由于我尝试通过此端口访问,因此出现以下错误
Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '<URL>'. This request has been blocked; the content must be served over HTTPS. polyfills.61502c8beb5856ffad29.js:1
Mixed Content: The page at 'https://mydomain/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://mydomain:8082/socket.io/?EIO=3&transport=polling&t=MTs8rqF'. This request has been blocked; the content must be served over HTTPS.
我的服务器来自Godaddy,我已经有ssl证书
我想知道如何打开通过https协议通信的端口,因为在尝试应用程序之前 在名为www.C9.io的测试服务器上,它可以正常工作,因为在此服务器上,端口已配置为可以通过使用http协议和https协议(两者)的url进行访问
感谢您的帮助,我对端口和服务器了解不多(这是我的第一个vps),非常感谢