LearnBoost/socket.io-client — pull request #342 by cris (2011-11-23 22:48:13+00:00)
Title: Partial fix #237 in client and #474 in server for duplicated reconnection in JSONP

Bug in client: https://github.com/LearnBoost/socket.io-client/issues/237
Bug in server: https://github.com/LearnBoost/socket.io/issues/474

Step to reproduce: https://github.com/LearnBoost/socket.io/issues/474#issuecomment-2833227

This fix for handshake on client. Currently it fixes only JSONP kind of handshake. I'm using v0.8.4 and in this version for my case all handshakes goes through JSONP (comet.site.com <=> site.com).

But newer version of sio-client added for line: https://github.com/LearnBoost/socket.io-client/blob/master/lib/socket.js#L137
part: && !io.util.ua.hasCORS

Now, most of handshakes work through AJAX and maybe only Opera does handshake through JSONP.
And ajax-handshake isn't fixed :(.

There are two way to fix AJAX-part:
1. Disable AJAX-handshake and use only JSONP-handshake
2. Try to implement fix for AJAX-part

I dont know, what you think about it. Please give me feedback. If you think item 2 is preferred, I can try to implement clean solution for it.