WebSocket on IE10 giving a SecurityError

I had this problem in Windows7/IE11 after applying a security patch. For Windows10/Edge is the same story.

As this is a local websocket (ws://localhost) you have to add ws:\\localhost\ to Internet Explorer configurations (Tools > Internet Options > Security > Local Intranet > Sites > Advanced).

IE11 local intranet sites configuration

In Windows 10/Microsoft Edge you will find this configuration in Control Panel > Internet Options.

UPDATE

The address of your webapp (https://test.dev.mydomain.net) must be added to the local intranet zone too. Note that in the image the webapp address should be added.


Browsers has a websocket limitation. For example Internet Explorer has default limit of websocket connections set to 6 per host header name. the same limitation is set for WinForms WebBrowser component.

The solution is to add values under key Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_WEBSOCKET_MAXCONNECTIONSPERSERVER in registry. Just add DWORD value with executable name , for example iexplore.exe (or your application executable name if you use Web browser component) and set value from range 2..128

Second option how to solve SecurityException is to create multiple subdomains.


Well, my question wasn't that successful, so I'll post the "workaround" I found.

I got another address for the website, in 194.247.. too. This, magically, solved it. Guess IE doesn't like mixing local and external stuff and watches the IP.

Anyways, I hope this may come in handy to anyone who's got the same issue.

If you have a solution to solve the "real" issue by configuring IE, let me know :)

Cheers,


It looks like IE throws a SecurityError if you're trying to open a websocket on a local (intranet) domain. To overcome this, you may disable IE's automatic algorithm for recognizing local sites. This can be done in Tools > Internet Options > Security > Local Intranet > Sites.

intranet detection settings

Uncheck all checkboxes (or only a particular one, if you know how exactly your domain did end up in intranet ones).

Note that IE uses (among other things) its proxy settings to determine local sites: if your domain is listed as excluded from proxying in proxy settings, then it will probably be treated as intranet one. This is why WebSockets work if you enable Fiddler: it modifies IE proxy settings and thus the list of intranet sites changes.