Changeset View
Changeset View
Standalone View
Standalone View
support/aphlict/server/lib/AphlictFlashPolicyServer.js
| Show All 40 Lines | _didConnect: function(socket) { | ||||
| socket.write(this._getFlashPolicyResponse()); | socket.write(this._getFlashPolicyResponse()); | ||||
| socket.end(); | socket.end(); | ||||
| }, | }, | ||||
| _didSocketError: function(socket, error) { | _didSocketError: function(socket, error) { | ||||
| this._log('<FlashPolicy> Socket Error: %s', error); | this._log('<FlashPolicy> Socket Error: %s', error); | ||||
| }, | }, | ||||
| _log: function(pattern) { | _log: function() { | ||||
| this._debug && this._debug.log.apply(this._debug, arguments); | this._debug && this._debug.log.apply(this._debug, arguments); | ||||
| }, | }, | ||||
| _getFlashPolicyResponse: function() { | _getFlashPolicyResponse: function() { | ||||
| var policy = [ | var policy = [ | ||||
| '<?xml version="1.0"?>', | '<?xml version="1.0"?>', | ||||
| '<!DOCTYPE cross-domain-policy SYSTEM ' + | '<!DOCTYPE cross-domain-policy SYSTEM ' + | ||||
| '"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">', | '"http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">', | ||||
| '<cross-domain-policy>', | '<cross-domain-policy>', | ||||
| '<allow-access-from domain="*" to-ports="' + this._accessPort + '"/>', | '<allow-access-from domain="*" to-ports="' + this._accessPort + '"/>', | ||||
| '</cross-domain-policy>' | '</cross-domain-policy>' | ||||
| ]; | ]; | ||||
| return policy.join("\n") + "\0"; | return policy.join('\n') + '\0'; | ||||
| } | } | ||||
| } | } | ||||
| }); | }); | ||||