Note that there are some explanatory texts on larger screens.

plurals
  1. POFlash SecurityDomain, P2P settings and multiply swfs
    primarykey
    data
    text
    <p>I have two swfs:</p> <ol> <li>application swf </li> <li>p2p client swf that allows to load data using rtmfp replication technology (through cirrus service)</li> </ol> <p>The main idea is to have one p2p loader on the certain domain that will able to work in p2p network without asking many times for permission for each domain, so for instance:</p> <ul> <li>application 1 (<a href="http://domain1.com/app.swf" rel="nofollow noreferrer">http://domain1.com/app.swf</a>) |</li> <li>application 2 (<a href="http://domain2.com/app.swf" rel="nofollow noreferrer">http://domain2.com/app.swf</a>) | &lt;--> p2p data loader (<a href="http://domainp2p.com/p2pcli.swf" rel="nofollow noreferrer">http://domainp2p.com/p2pcli.swf</a>)</li> <li>application N (<a href="http://domainN.com/app.swf" rel="nofollow noreferrer">http://domainN.com/app.swf</a>) |</li> </ul> <p>The p2p client loads binary data by request, content really does not matter I believe.</p> <p>So, I load p2pclient swf using following class (<strong>app.swf</strong>)</p> <pre><code>public class ClientLoader { // .. some code public function load(cb:Function, err:Function):void { _cb = cb; _err = err; var loader:Loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, _onLoaded); loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, _onIoError); loader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _onSecurityError); // note that context has neither application domain nor security domain loader.load(new URLRequest(_url), new LoaderContext()); } private function _onLoaded(e:Event):void { trace("Loaded. Connecting to the p2p network..."); _client = e.target.content; _client.addEventListener(Event.CONNECT, _onClientReady); _client.connect(); } private function _onClientReady(e:Event):void { _cb(_client); } } } </code></pre> <p>The p2pclient itself (<strong>p2pcli.swf</strong>):</p> <pre><code>public class P2P extends Sprite { public function SqP2P() { Security.allowDomain("*"); } public function connect():void { _connection = new NetConnection(); _connection.addEventListener(NetStatusEvent.NET_STATUS, _netStatus); _connection.connect(CIRRUS_ADDRESS, CIRRUS_KEY); // after successful connect this method called _loadGroup(); } private method _loadGroup():void { var spec:GroupSpecifier = new GroupSpecifier(_name); spec.serverChannelEnabled = true; spec.objectReplicationEnabled = true; _group = new NetGroup(connection, spec.groupspecWithAuthorizations()); _group.addEventListener(NetStatusEvent.NET_STATUS, _netStatus); } private function _netStatus(event:NetStatusEvent):void { trace("NetStatusEvent:", event.info.code); } } </code></pre> <p>But it looks like that Flash Player ignores the security session and is trying to save the pop-up settings for the domain that app.swf belongs to, but not for the p2pcli.swf domain. Why?!</p> <p><img src="https://i.stack.imgur.com/VSFNd.png" alt="p2p settings box"></p> <p>I have absolutely same code, but p2pcli.swf replaced with swf that stores data in Local Shared Object and all the domain1-2-N.com has access to it. </p> <p>Any ideas?</p> <p>I know, my English is crap :(</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload