blazeds-proxy-400.png

FlashPlayer cross domain policy will not enable a Flash application downloaded from domain A to be requesting services from an another domain B. Unless domain B is actually exposing a cross-domain friendly policy file. For example Google does : http://www.google.com/crossdomain.xml.

In general, such a friendly crossdomain.xml file is not exposed by targeted service provider. In such case we can use BlazeDS proxy service.

We first need to configure the HTTPService to be using a proxy :

<mx:HTTPService useProxy="true" url=". ." />

Second, we need to install and launch BlazeDS. With trunkey BlazeDS[1] distribution it's straitforward. Obviously you need a Java-powered server : a sole Php-server will not help.

Consider you install the BlazeDS server in an intranet and a firewall has to be used to access the service provider B. You will need to configure BlazeDS so as to use the firewall proxy. If you just unzipped the turnkey distribution and launch BlazeDS, i guess you did not read corresponding 1000-page doc.

But it's just Java, you will try the general JVM-based approach, and you will be lauching BlazeDS with JMV args :

-DhttpProxyHost=<you-fire-wall> -DhttpProxyPort=3128

you will still fall in connection timeout. It's a pity. Even more when you know that BlazeDS is using Jakarta HttpClient support ; which actually honor above-mentionned configuration...

BlazeDS overrides that feature. The only way is to refer to documentation and to find out where firewall proxy can be configured. Not so easy, keyword proxy hardly allways refer to the proxy service...

Config file proxy-config.xml has to be customized :

<service id="proxy-service" class="flex.messaging.services.HTTPProxyService">
   <properties>
        . . .
        <allow-lax-ssl>true</allow-lax-ssl>
        <external-proxy>
                <server>your-firewall</server>
                <port>3128</port>
        </external-proxy>