You can use 'loadPolicyFile' to load a crossdomain.xml file from an
alternate url via http.

 

The loadPolicyFile method contains the ability to load over xmlsocket:
urls and I imagine it might also support ftp: and https: urls as well. I
have not tested this functionality but if it is using the base
networking in the player it "might" work.

 

Ok, testing with:

 

One issue is that this will require a wide open ftp server for read
operations

flash.system.Security.loadPolicyFile( 'ftp://server/crossdomain.xml' )

 

System.security.loadPolicyFile("xmlsocket://socks.mysite.com:123");

mySocket.connect("socks.mysite.com", 456);

 

More testing needed here. I do have a set of binary Socket servers
coming in a blog post later this month. The examples contain 4 servers
that I wrote for working with binary Socket. I personally think that
this is one of the coolest parts of Flash Player 9. 

 

More to come...

 

Ted Patrick 

Flex Technical Evangelist 

Adobe Systems 

 

http://www.onflex.org <http://www.onflex.org>  

http://www.linkedin.com/in/tedpatrick
<http://www.linkedin.com/in/tedpatrick>  

________________________________

From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of elad_nyc
Sent: Tuesday, January 30, 2007 5:55 PM
To: [email protected]
Subject: [flexcomponents] Re: Problem Creating binary socket based
connection to remote server

 

Hi Ted,

Thanks for the reply.

I heard that it is possible to create the connection 
using "flash.system.Security" class.

Is there is any way to connect to lower ports such as FTP or POP 
without posting an XML file, or python script on the remote server?

Best, Elad.

--- In [email protected]
<mailto:flexcomponents%40yahoogroups.com> , "Ted Patrick" <[EMAIL PROTECTED]>

wrote:
>
> Elad,
> 
> 
> 
> Socket based connections to low ports require a special policy file 
be
> placed on port 80 of the target server.
> 
> 
> 
> Flash Player delegates server security to the server by loading an 
XML
> file on this default url : http://server/crossdomain.xml
<http://server/crossdomain.xml> 
> 
> In the case of flash.net.Socket and flash.net.XMLSocket, you need to
> allow low port connections within this file like so:
> 
> 
> 
> <?xml version="1.0"?>
> 
> <!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> 
> 
> <allow-access-from domain="*" to-ports="507" /> 
> 
> <allow-access-from domain="*.mysite.com" to-ports="507,516" /> 
> 
> <allow-access-from domain="*.myothersite.com" to-ports="516-
523" />
> 
> 
> <allow-access-from domain="www.myothersite.com"
> to-ports="507,516-523" /> 
> 
> <allow-access-from domain="www.mysite.com" to-ports="*" /> 
> 
> </cross-domain-policy>
> 
> 
> 
> Assuming you want to connect to port 21 (FTP) you would do the
> following:
> 
> 
> 
> <?xml version="1.0"?>
> 
> <!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> 
> 
> <allow-access-from domain="*" to-ports="21" />
> 
> </cross-domain-policy>
> 
> 
> 
> Also make sure to limit the domain to the domain that your SWF file 
is
> hosted from. * allows connections from flash players from any 
domain.
> 
> 
> 
> Here is my post on the subject from 2003.
> 
> http://chattyfig.figleaf.com/pipermail/flashcoders/2003-
<http://chattyfig.figleaf.com/pipermail/flashcoders/2003-> 
September/089698
> .html
> 
> 
> 
> Also many times there is no HTTP server on specialized hardware. I 
wrote
> this HTTP server in python to serve the crossdomain.xml file 
without the
> need to install a heavier process like Apache or IIS. Make sure to
> modify the crossdomain.xml data embedded in the server below if you 
go
> this route.
> 
> 
> 
> http://www.powersdk.com/download/FCHS.py
<http://www.powersdk.com/download/FCHS.py> 
> 
> 
> 
> Hope this helps.
> 
> 
> 
> Ted Patrick 
> 
> Flex Technical Evangelist 
> 
> Adobe Systems 
> 
> 
> 
> http://www.onflex.org <http://www.onflex.org>  <http://www.onflex.org
<http://www.onflex.org> > 
> 
> http://www.linkedin.com/in/tedpatrick
<http://www.linkedin.com/in/tedpatrick> 
> <http://www.linkedin.com/in/tedpatrick
<http://www.linkedin.com/in/tedpatrick> > 
> 
> ________________________________
> 
> From: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
> [mailto:[email protected]
<mailto:flexcomponents%40yahoogroups.com> ] On Behalf Of elad_nyc
> Sent: Monday, January 29, 2007 9:54 PM
> To: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
> Subject: [flexcomponents] Problem Creating binary socket based
> connection to remote server
> 
> 
> 
> I am trying to create a connection to FTP using the socket class. 
The 
> remote server I am trying to connect is on port.
> 
> Is it possible to create a connection to the remote server?
> 
> I am keep getting securities error messages.
> 
> Best, Elad.
>

 

Reply via email to