Cannot connect to websocket server from IE9. #126

piotrfilipiuk opened this Issue Nov 16, 2012 · 3 comments


None yet
2 participants

I have an error when connecting to the WebSocket server from IE 9. Everything works well when using Firefox and Chrome.

I use the following setup:
WebSocket server: XSocket (
Web browser: IE 9

The output from the IE Console:

LOG: [WebSocket] debug enabled
LOG: [WebSocket] policy file: xmlsocket://
LOG: [WebSocket] connected
LOG: [WebSocket] request header:
GET /SimpleController/ HTTP/1.1
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: aVo5CFcxWWoyZnwHNUUkMg==
Origin: http://localhost:52281
Sec-WebSocket-Version: 13

LOG: [WebSocket] response header:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade

[WebSocket] failed to parse response header line: Sec-WebSocket-Accept:3z4fC46FtGSvBs61d0lQfgKYXJs=
LOG: [WebSocket] closed

Hence it fails during the handshake. I have the Flash socket policy file provided (I am using I use the following javascript code:

<script type="text/javascript" src="swfobject.js"></script> <script type="text/javascript" src="web_socket.js"></script> <script type="text/javascript"> // Let the library know where WebSocketMain.swf is: WEB_SOCKET_SWF_LOCATION = "WebSocketMain.swf"; // Write your code in the same way as for native WebSocket: var ws = new WebSocket("ws://"); ws.onopen = function() { alert("opened"); }; ws.onmessage = function(e) { // Receives a message. alert(; }; ws.onclose = function() { alert("closed"); }; </script>



gimite commented Nov 17, 2012

It looks like a bug in web-socket-js that it requires whitespace after ":" in the response header (Sec-WebSocket-Accept). I'll fix it. Thanks for the report.

When can I expect the issue to be fixed?


gimite commented Dec 4, 2012

Sorry for late. It should be fixed in the repository.

@gimite gimite closed this Dec 4, 2012

@mantoni mantoni referenced this issue in socketio/ Jun 5, 2013


Upgrade WebSocketMain.swf and WebSocketMainInsecure.swf #558

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment