In this case even if the SWF is located on the same server, low port
access below 1024 requires a crossdomain.xml request.

 

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 slangeberg
Sent: Wednesday, January 31, 2007 12:45 PM
To: [email protected]
Subject: Re: [flexcomponents] Re: Problem Creating binary socket based
connection to remote server

 

Sorry if I haven't tracked this thread in its entirety, but I understand
that the flash player is trying to access a different domain than the
movie's hosted on? 

If so, you may want to consider an abstraction layer on your current
domain that then connects to the second domain and serves as a relay.
It's how you can get around the security restriction when trying to load
webservices from somewhere else. 

Such as:

Flash -> Server [your webservice] -> Remote Server (someone else's -
Public webservice)

Just read about this in an old article from the iteration:two(?) guy on
adobe.

Granted, you're not using a webservice, but the same should apply to a
socket server. Also gives you the 'abstraction' allowing service changes
to occur in one place, rather than in a bunch of clients. 

-Scott

On 1/31/07, elad_nyc <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote:

Thanks for your reply I will most definitely play around with 
the `loadPolicyFile'.

I have successfully created a connection to the binary socket; 
however I had to place the "crossdomain.xml "policy to the flash 
player as per your advice.

At this point I am looking for a way around placing 
the "crossdomain.xml" on the remote server and connecting to the 
lower ports automatically?

Can't I just "tell" flash NOT to check for the file and just create 
the connection automatically? 

There is a way since "RFC2817Socket" is not using the XML file, 
however I don't want to spend hours trying to understand what was 
done in the "RFC2817Socket" component and I need all the functions in 
the "Socket" class.

Best, Elad Elrom

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

wrote:
>

> 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 <ftp://server/crossdomain.xml> ' )
> 
> 
> 
> System.security.loadPolicyFile("xmlsocket://socks.mysite.com:123");
> 
> mySocket.connect("socks.mysite.com <http://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.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: Tuesday, January 30, 2007 5:55 PM
> To: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
> 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> 
> <mailto:flexcomponents%40yahoogroup s.com <http://s.com> > , "Ted
Patrick" 


<tpatrick@>
> 
> 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> 
> <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> 
> <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
<http://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> 
> <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-> 
> <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> 
> <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.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> > 
> > <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:flexcomponents%40yahoogroup s.com <http://s.com> > 
> > [mailto:[email protected]
<mailto:flexcomponents%40yahoogroups.com> 
> <mailto:flexcomponents%40yahoogroup s.com <http://s.com> > ] On Behalf
Of elad_nyc
> > Sent: Monday, January 29, 2007 9:54 PM
> > To: [email protected]
<mailto:flexcomponents%40yahoogroups.com> 
> <mailto:flexcomponents%40yahoogroup s.com <http://s.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.
> >
>




-- 

: : ) Scott 

 

Reply via email to