缺少WebSocket“连接”标头

时间:2015-08-04 13:45:45

标签: websocket iis-7.5 intersystems-cache

我正在尝试使用客户端的以下行连接到Intersystems Cache CSP Websocket:

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

我在Chrome控制台中收到此错误:

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

请求标头:

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

响应标题:

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

服务器正在使用IIS 7.5,它在技术上不支持WebSocket,但看起来所有的websocket标题都确实存在,除了一个:“Connection”:“Upgrade”。

有没有办法将“连接”标头注入握手响应?是否有一些客户端配置可以忽略丢失的标头?

感谢。

1 个答案:

答案 0 :(得分:2)

不幸的是,对于WebSockets支持,您需要IIS 8 + Windows 8和Windows Server 2012

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