diff --git a/lib/socket.js b/lib/socket.js index c1496c8bc..cf4f52d95 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -36,6 +36,7 @@ , 'max reconnection attempts': 10 , 'sync disconnect on unload': true , 'auto connect': true + , 'flash policy port': 10843 }; io.util.merge(this.options, options); diff --git a/lib/transports/flashsocket.js b/lib/transports/flashsocket.js index b85001c91..d321aeaaa 100644 --- a/lib/transports/flashsocket.js +++ b/lib/transports/flashsocket.js @@ -44,7 +44,7 @@ Flashsocket.prototype.name = 'flashsocket'; /** - *Disconnect the established `FlashSocket` connection. This is done by adding a + * Disconnect the established `FlashSocket` connection. This is done by adding a * new task to the FlashSocket. The rest will be handled off by the `WebSocket` * transport. * @@ -105,6 +105,7 @@ Flashsocket.prototype.ready = function (socket, fn) { function init () { var options = socket.options + , port = options['flash policy port'] , path = [ 'http' + (options.secure ? 's' : '') + ':/' , options.host + ':' + options.port @@ -121,6 +122,10 @@ WEB_SOCKET_SWF_LOCATION = path.join('/'); } + if (port !== 843) { + WebSocket.loadFlashPolicyFile('xmlsocket://' + options.host + ':' + port); + } + WebSocket.__initialize(); Flashsocket.loaded = true; }