WebSocket on loopback : Cross zone connection not allowed error on MS Edge

edge websocket
microsoft edge websockets
allow localhost loopback
edge localhost loopback
websocket cross zone connection not allowed

I have a script which uses websocket on loopback. Since website is served over the internet and websocket over intranet, I observe "SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed" in Microsoft Edge. I observe similar problem in Internet explorer as well. IE and MS Edge categories URLs into different zones, each with unique privileges and hence does not allow cross zone connections.

Can I solve this by enabling CORS (Cross Origin Resource Sharing) or CORS works only for different origins from same zone. Or is there any other solution to this problem without altering any settings on the client device?

you may find the answers here

Microsoft Edge does not allow localhost loopback for websockets

Or you may run this on your command prompt

CheckNetIsolation LoopbackExempt -a -n="Microsoft.MicrosoftEdge_8wekyb3d8bbwe"

Microsoft Edge WebSocket Error: SECURITY_ERR, Cross zone , Microsoft Edge WebSocket Error: SECURITY_ERR, Cross zone connection not allowed #498. Closed. slprogrp opened this issue No quotes, Tick/Un-tick the " allow Localhost Loopback" feature. Which I did but it made no� I have a script which uses websocket on loopback. Since website is served over the internet and websocket over intranet, I observe "SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed" in Microsoft Edge. I observe similar problem in Internet explorer as well.

When you instantiate socket.io in your browser js, use 127.0.0.1 instead of localhost.

const socket = io("http://127.0.0.1:3000");

instead of

const socket = io("http://localhost:3000");

Websocket error on Microsoft Edge, Websocket error on Microsoft Edge RRS feed SCRIPT12017: SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed I have verified that in the about:flags localhost loopback is enabled. Microsoft Edge helps to defend from increasingly sophisticated and prevalent web-based attacks against Windows. While most websites are safe, some sites have been designed to steal personal information or gain access to your system’s resources.

This may not answer your question, but useful for others.

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.

Websocket error on Microsoft Edge while running CheckNetIsolation , Here is the results of running CheckNetIsolation LoopbackExempt -s WebSocket Error: SECURITY_ERR, Cross zone connection not allowed. Currently, we use a brute-force method in IE to allow WebSocket communication by telling the computer to stop Automatically detect intranet network. This is a stop-gap which has adverse side-effects on a corporate LAN as it prompts for login credentials when accessing web resources.

Microsoft Edge 44.18362.387.0, I get the following error. SCRIPT12017: SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed. Here is the� Stack Overflow Public questions and answers; Teams Private questions and answers for your team; Enterprise Private self-hosted questions and answers for your enterprise; Jobs Programming and related technical career opportunities

Microsoft Edge : Cross zone connection error, IE and MS Edge categories URLs into different zones, each with unique privileges and hence does not allow cross zone connections. The same javascript is used in all Browser. In Edge, the Onclose event returns 1006 "The connection was closed abnormally, e.g., without sending or receiving a Close control frame" after a couple of seconds. Do I need to do something to get this working on Edge or is it time to face the reality that it not possible to use websockets on localhosts?

SCRIPT12017: SCRIPT12017: WebSocket Error: SECURITY_ERR , Edge shows the following error when script try to connect to 127.0.0.1:4530. I have a script that uses WebSocket on loopback. "SCRIPT12017: WebSocket Error: SECURITY_ERR, Cross zone connection not allowed" WebSocket Error: SECURITY_ERR, Cross zone connection not allowed" and; why I� • 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. In the Control Panel - Internet Option, select the Security Tab. In the Security tab, select Local intranet zone.