mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Merge pull request #196 from 3rd-Eden/master
Load swf based on the connection options
This commit is contained in:
@@ -120,11 +120,12 @@
|
||||
};
|
||||
|
||||
var url = [
|
||||
'http' + (options.secure ? 's' : '' ) + '://' + options.host + ':' + options.port
|
||||
, this.options.resource
|
||||
, io.protocol
|
||||
, '?t=' + + new Date
|
||||
].join('/');
|
||||
'http' + (options.secure ? 's' : '') + ':/'
|
||||
, options.host + ':' + options.port
|
||||
, this.options.resource
|
||||
, io.protocol
|
||||
, '?t=' + + new Date
|
||||
].join('/');
|
||||
|
||||
if (this.isXDomain()) {
|
||||
var insertAt = document.getElementsByTagName('script')[0]
|
||||
|
||||
@@ -86,16 +86,22 @@
|
||||
|| !('__initialize' in WebSocket) || !swfobject
|
||||
) return false;
|
||||
|
||||
var supported = swfobject.getFlashPlayerVersion().major >= 10;
|
||||
var supported = swfobject.getFlashPlayerVersion().major >= 10
|
||||
, options = socket.options
|
||||
, path = [
|
||||
'http' + (options.secure ? 's' : '') + ':/'
|
||||
, options.host + ':' + options.port
|
||||
, options.resource
|
||||
, 'static/flashsocket'
|
||||
, 'WebSocketMain' + (socket.isXDomain() ? 'Insecure' : '') + '.swf'
|
||||
];
|
||||
|
||||
// Only start downloading the swf file when the checked that this browser
|
||||
// actually supports it
|
||||
if (supported){
|
||||
if (typeof WEB_SOCKET_SWF_LOCATION === 'undefined'){
|
||||
// Set the correct file based on the XDomain settings
|
||||
var path = '/socket.io/static/flashsocket/WebSocketMain';
|
||||
path = path + (socket.isXDomain() ? 'Insecure' : '') + '.swf';
|
||||
WEB_SOCKET_SWF_LOCATION = path;
|
||||
WEB_SOCKET_SWF_LOCATION = path.join('/');
|
||||
}
|
||||
|
||||
WebSocket.__initialize();
|
||||
|
||||
Reference in New Issue
Block a user