Cannot connect to xsockets.net websocket server from IE9. #126

Closed
piotrfilipiuk opened this Issue Nov 16, 2012 · 3 comments

Comments

Projects
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 2.0.3.1 (http://xsockets.net/)
Web browser: IE 9

The output from the IE Console:

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

LOG: [WebSocket] response header:
HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept:3z4fC46FtGSvBs61d0lQfgKYXJs=

[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 http://socketpolicyfile.codeplex.com/). 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://example.com:10081/"); ws.onopen = function() { alert("opened"); }; ws.onmessage = function(e) { // Receives a message. alert(e.data); }; ws.onclose = function() { alert("closed"); }; </script>

Regards,
Piotr

Owner

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?

Owner

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/socket.io-client Jun 5, 2013

Closed

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