99percentpeople / weblink

P2P web chat and file transfer, file synchronization application using WebRTC
https://webl.ink
MIT License
275 stars 18 forks source link

Docker构建websocket server的TLS问题 #10

Open hdu12 opened 2 days ago

hdu12 commented 2 days ago

nginx反代https没什么问题,但是会遇到websocket问题 Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.

对websocket不太熟悉,猜测是docker构建的ws server没有配置wss

希望作者能看一下,谢谢

99percentpeople commented 2 days ago

将VITE_WEBSOCKET_URL=ws://xxxxxx/ws换为wss://xxxxxx/ws就可以了

hdu12 commented 2 days ago

感谢回复,那我是不是要把ws server的tls给开起来,我改了docker compose不知道是不是正确

ws-server: build: context: https://github.com/99percentpeople/weblink-ws-server.git environment:

99percentpeople commented 2 days ago

对了忘记说了,如果是wss的话检查你端口是不是443,如果原来是ws://xxx:8080/ws,请改为wss://xxx:443/ws,如果原来浏览器打开过这个页面,请在设置页面重置ws服务链接