Microsoft Edge does not allow localhost loopback for websockets
In the Microsoft Edge browser type "About:flags"
in the title bar (search bar). No quotes, Tick/Un-tick the "allow Localhost Loopback"
feature.
Edge on Win Build 10240. (still works upto New Edge (chrome based))
After some research I found the source of error. Here is my repo, to reproduce error: https://github.com/AZaviruha/ms-edge-ws-strange
In short, when you call new WebSocket
in MS Edge, it does not generate exception, when you call it with wrong "local"-host argument:
var socket, path;
var hosts = ['localhost', '127.0.0.1'];
for (var i in hosts) {
path = 'ws://'+hosts[i]+':9446';
console.log( '===> Tested path :: ', path );
try {
socket = new WebSocket( path );
break;
}
catch ( e ) {
// !!! Never shown !!!
console.error( '===> WebSocket creation error :: ', e );
}
}
Because of this, you can't "retry" to connect with different hosts.
By the way, if you try non-local non-existent host, it will generate exception!