mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
32 lines
933 B
JavaScript
32 lines
933 B
JavaScript
io.Transport.flashsocket = io.Transport.websocket.extend({
|
|
|
|
init: function(base){
|
|
this.__super__(base);
|
|
},
|
|
|
|
_onClose: function(){
|
|
if (!this.base.connected){
|
|
// something failed, we might be behind a proxy, so we'll try another transport
|
|
this.base.options.transports.splice(io.util.Array.indexOf(this.base.options.transports, 'flashsocket'), 1);
|
|
this.base.transport = this.base.getTransport();
|
|
this.base.connect();
|
|
return;
|
|
}
|
|
return this.__super__();
|
|
}
|
|
|
|
});
|
|
|
|
io.Transport.flashsocket.check = function(){
|
|
if ('navigator' in window && navigator.plugins){
|
|
return !! navigator.plugins['Shockwave Flash'].description && ('__initialize' in WebSocket);
|
|
}
|
|
|
|
if ('ActiveXObject' in window){
|
|
try {
|
|
return !! new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version') && ('__initialize' in WebSocket);
|
|
} catch (e){}
|
|
}
|
|
|
|
return false;
|
|
}; |