After some research, I found the source of the error. Here is my repo to reproduce the error: https://github.com/AZaviruha/ms-edge-ws-strange
In short, when you call new WebSocket on MS Edge, it does not throw an exception when you call it with the 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 ) {
Because of this, you cannot “retry” to connect to different hosts.
By the way, if you try a non-local non-existent host, it will throw an exception!
source share