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

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";>

<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";>

<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-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

 

Hope this helps.

 

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: Monday, January 29, 2007 9:54 PM
To: [email protected]
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