web socket error response 302 - opcode -1

problem:
connecting a HTML5 client to a web socket server, has this error response in Google Chrome:

WebSocket connection to 'ws://mysite/' failed: Error during WebSocket handshake: Unexpected response code: 302

explanation 1 - WRONG!:
this seems to be a kind of CORS error:
it occurred for me, when the client JavaScript was served up from a different web site, than the web site that hosts the Web Socket server.

explanation 2 - Server did not support web sockets
The server was Windows 2008 R2, with IIS 7.
IIS 7 does not support web sockets.

Web sockets are supported by IIS8+.
A suitable server OS is: Windows Server 2012 R2 (has IIS 8.5).

related:
explanation:
http://stackoverflow.com/questions/17957949/does-self-hosted-signalr-require-windows-server-2012-in-order-to-use-websockets

self-hosting web sockets via fleck:
https://github.com/statianzo/Fleck

my original 'problem post' on stackoverlow:
stackoverflow.com/questions/38104456/websocket-hosted-in-aspnet-core-rc2-iis-websocket-connection-to-wss-xxx-fa

Comments