WebSocket connection fails on Chrome without SSL

后端 未结 3 607
粉色の甜心
粉色の甜心 2021-01-07 22:59

I\'m setting up a WebSocket between a standard web page and a Tomcat v7.0.62 server. The connection works fine with Tomcat SSL turned on/off on Firefox, Edge and IE11. How

3条回答
  •  庸人自扰
    2021-01-07 23:50

    This is a Chrome specific behavior. Chrome doesn't allow unsecure websocket (ws) connections to localhost (only wss, so you should setup a TLS certificate for your local web/websocket server). But the same should work without any issues in Firefox and other browsers.

    Please refer the Chrome bug report on Chromium regarding this issue. This particular problem is intentional, and they have made this change to make Chrome more secure by preventing attacks against internal network devices and processes listening on localhost.

    https://bugs.chromium.org/p/chromium/issues/detail?id=378566

提交回复
热议问题