Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IE6 handshake error #413

Closed
Deisss opened this issue Apr 9, 2012 · 6 comments
Closed

IE6 handshake error #413

Deisss opened this issue Apr 9, 2012 · 6 comments

Comments

@Deisss
Copy link

Deisss commented Apr 9, 2012

I'm getting a problem while connecting server using IE6 (this problem does not exist under FF 11 & Chrome (v16 or 17) & IE 9) :

Here is the connect system :
this.socket = io.connect('192.168.0.20/chat', {
'reconnect': true,
'reconnection delay': 500,
'max reconnection attempts': 1000,
'port': 8080
});

Under IE6, this result to a syntax error (property not exist, according to IE debug bar) :
//Line 1620
xhr.withCredentials = true;

I also add that's there is no site scripting (both index.html and socket.io are under 192.168.0.20)

@Deisss
Copy link
Author

Deisss commented Apr 9, 2012

forgot to say : socket.io latest version (0.9.5)

@Gyaguchi
Copy link

I also detected the same problem too.
Environment (socket.io version:0.9.6 and using IE6)
as for the cause, IE6(ActiveXObject('Microsoft.XMLHTTP')) is not supporting xhr.withCredentials.
Although it has avoided by the following patch, how about this?

--- a/socket.io/node_modules/socket.io-client/lib/socket.js
+++ b/socket.io/node_modules/socket.io-client/lib/socket.js
@@ -148,7 +148,9 @@
       var xhr = io.util.request();

       xhr.open('GET', url, true);
-      xhr.withCredentials = true;
+      if (xhr.withCredentials) {
+       xhr.withCredentials = true;
+      }
       xhr.onreadystatechange = function () {
         if (xhr.readyState == 4) {
           xhr.onreadystatechange = empty;

@Jedius
Copy link

Jedius commented Apr 28, 2012

have same problem.. this patch let avoid error message, but any events in ie6 just not work.

my code:

server:
io = require('socket.io').listen(app)
io.configure ->
.. io.set("transports", ["xhr-polling"]);

io.sockets.on "connection", (socket) ->
.. console.log 'connected'

client:
socket = io.connect("http://192.168.1.3:4500")
socket.on 'connect', ->
.. alert 'connected'

in result, i see 'connected' on the server, but not alert in ie.

logs:

debug - served static content /socket.io.js
debug - client authorized
info - handshake authorized 3510702431436887415
debug - setting request GET /socket.io/1/xhr-polling/3510702431436887415?t=1335621627442
debug - setting poll timeout
debug - client authorized for
debug - clearing poll timeout
debug - xhr-polling writing 1::
debug - set close timeout for client 3510702431436887415
connected

bad news is that 30% сhinese use ie6, as said my client, and it's necessary for him. building 2 synchronous chats (with socket and without) is nightmare =\

@stevegeek
Copy link

Try using JSON-P polling instead of XHR polling

@Jedius
Copy link

Jedius commented Apr 28, 2012

It works, thanks!

@Krinkle
Copy link

Krinkle commented Nov 17, 2014

Karma uses transports = ['websocket', 'flashsocket', 'xhr-polling', 'jsonp-polling']; by default. That includes jsonp-polling.

socket.io (more specifically nowadays, engine.io) says it supports browsers "as low as IE 5.5". Ideally that means it works out of the box and not require users hardcode transports = ['jsonp-polling'] based on some feature test, UA sniffing or even unconditionally.

See also karma-runner/karma#983.

@rauchg rauchg closed this as completed Nov 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants