SCRIPT12017: SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed

Internet Zones (MSIE and Edge)

Internet Explorer and Edge both disallow web socket connections between “internet zones” by default.  In these cases, the following error messages will be logged in the console:

•             Internet Explorer: “SCRIPT5022: SecurityError”

•             Edge: “SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed”

 

Here are 2 changes that helped me fix the issue and establish a localhost WebSocket connection.

  1. In the Control Panel - Internet Option, select the Security Tab. In the Security tab, select Local intranet zone. Click on Sites button and uncheck all checkboxes in Local intranet dialog. OR
  2. In the Control Panel - Internet Option, select the Security Tab. In the Security tab, select Local intranet zone. Click on Sites button and then on Advanced button in the Local intranet dialog, add the required web address to the same zone as localhost. 
  3. 注意:第二个方法未起作用,最后使用的是第一个方法

原因是:浏览器安全限制不允许跨域访问

参考:

https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/f0e96358-e832-45ea-8710-caa0e3801c92/websocket-error-on-microsoft-edge?forum=iewebdevelopment

https://stackoverflow.com/questions/47471024/websocket-on-loopback-cross-zone-connection-not-allowed-error-on-ms-edge

https://pisquare.osisoft.com/community/developers-club/restful-pi-system-access/blog/2018/6/4

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值