1
votes

I am trying to connect to Intersystems Cache CSP Websocket with the following line from the client:

var ws = new WebSocket("ws://" + window.location.host + "/path/ClassName.cls");

And I'm getting this error in chrome console:

WebSocket connection to 'ws://<server address>' failed: Error during WebSocket handshake: 'Connection' header is missing

The request headers:

Accept-Encoding:gzip, deflate, sdch
Accept-Language:en-US,en;q=0.8,he;q=0.6
Cache-Control:no-cache
Connection:Upgrade
Cookie:CSPWSERVERID=Cache for Windows (x86-64) 2013.1.1 (Build 501_1_13062) Sun Aug 11 2013 23:20:33 EDT
Host:<host-ip>
Origin:http://<host-ip>
Pragma:no-cache
Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits
Sec-WebSocket-Key:<the key>
Sec-WebSocket-Version:13
Upgrade:websocket
User-Agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.125 Safari/537.36

And the response headers:

Date:Tue, 04 Aug 2015 11:45:54 GMT
Sec-WebSocket-Accept:<some key>
Sec-WebSocket-Protocol:chat
Server:Microsoft-IIS/7.5
Transfer-Encoding:chunked
Upgrade:websocket
X-Powered-By:ASP.NET

The server is using IIS 7.5, which technically doesn't support WebSocket, but it seems that all the websocket headers are indeed in place, except one: "Connection":"Upgrade".

Is there any way to inject the "connection" header into the handshake response? Is there some client configuration that can disregard the missing header?

Thanks.

1
Even if you can inject the header, do you think the IIS server will keep the sockets open? It seems to me, that the server might close the connection even after a successful handshake... I would recommend switching the server rather than working on a workaround. - Myst
Perhaps you are right. Regrettably upgrading to IIS8 requires upgrading the servers from 2008 to 2012, which is quite a long political process in a large organization. - syonip
Perhaps installing apache or nginx on the 2008 servers will be easier....either way, good luck! - Myst

1 Answers

2
votes

Unfortunately for WebSockets support you need IIS 8 + Windows 8 and Windows Server 2012

http://docs.intersystems.com/cache20152/csp/docbook/DocBook.UI.Page.cls?KEY=GCGI_oper_config#GCGI_websockets