Closed max-mapper closed 11 years ago
Oh so setting secure: true
still fails correct?
If you can get me some more debugging information that would be great.
ok, turns out socket.io assumes that if window.location.href
is not the same host as the host you pass into io.connect
then it should skip xhr-polling
. you can override this behavior by monkeypatching thusly:
io.Socket.prototype.isXDomain = function(){ return false; }
* it assumes that only if CORS is not supported as well (io.util.ua.hasCORS
needs to be false
). Which is not on Android apparently, but WebView
s still have the ability to disregard the origin security model. I'm introducing an option to solve this more elegantly without the override.
if you restrict the transports (on both server and client settings) to ['websocket', 'xhr-polling'] then embedded webviews using socket.io won't be able to connect and will emit the connect_failed event