diff --git a/lib/socket.js b/lib/socket.js index 3d60cea3..ec6176b9 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -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] diff --git a/lib/transports/flashsocket.js b/lib/transports/flashsocket.js index 6f642cc1..291921dd 100644 --- a/lib/transports/flashsocket.js +++ b/lib/transports/flashsocket.js @@ -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();