LearnBoost/socket.io-client — pull request #443 by hsume2 (2012-06-20 21:37:19+00:00)
Title: Fixes XDR from HTTP => HTTPS not falling back properly

We ran into an issue on IE9 where XDR would fail because of cross-protocol limitation of [XDR](http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx). It would return `SCRIPT 5 Access is denied.`. In this situation, it should fallback to JSONP.

After some investigation @mixu and I discovered why it wasn't falling back. `Socket.prototype.getTransport` triggers two checks, one with XHR and one with XDR.

1) XHR.check with XMLHttpRequest.

```
uses_xdomainrequest is false
socket.options.secure is 'https'
socket_protocol is 'https'
global.location.protocol is 'http'
is_cross_protocol is true
returns true
```

2) XHR.check with XDomainRequest.

```
uses_xdomainrequest is true
socket.options.secure is null
socket_protocol is 'http'
global.location.protocol is 'http'
is_cross_protocol is false
return true;
```
Instead the second check should return false and then JSONP would take over. Please take a look and let me know what you think.

P.S. I'm not quite sure how to add a test case for this as I keep getting:

```bash
uncaught undefined: Error: Cannot find module 'should'
```