Flash player has cross-domain security policy that restricts Flex applications from retrieving data from remote third party servers. Unfortunately, certain sites have restrictive polices, or no cross-domain policy at all, making it impossible for Flex clients hosted on other domains to access their service.
LiveCycle Data Services ES, or its open source variant, BlazeDS, offer proxy service that could help Flex clients bypass the cross-domain restriction.
Flash player has cross-domain security policy that restricts Flex applications from retrieving data from remote third party servers. At runtime, when a network request is made from your Flex application, may it be HTTP or SOAP, the Flash player examines the cross domain policy file on the remote server before the data could be retrieved.
The policy file is an XML file named crossdomain.xml, residing at the root of the remote server. The syntax is,
<allow-access-from domain="Domain name or IP of the client" />
The Yahoo Search API server, for example, allows direct access from third party clients (http://search.yahooapis.com/crossdomain.xml). Notice how the allow-access-from node is set to the wildcard *. Unfortunately, certain sites have more restrictive polices, or no cross domain policy at all. In that case, you need to set up your own proxy server with either LiveCycle Data Services ES or BlazeDS.
After installing LiveCycle Data Services ES or BlazeDS, navigate to the application directory.
The data service proxy configration file, proxy-config.xml, resides under the WEB-INF/flex directory. In your configuration file, there should be one default destination node,
The default proxy destination will forward HTTP payload with an URL specified by your Flex client. Before you could use the proxy service, you must specify the permitted proxy destinations using the dynamic-url property,
To access the proxy service from your Flex application, ensure your application is properly wired to the data service, and set the useProxy attribute to true,
The named proxy service is just like a default proxy service, but with the addition of a URL property,
To access a named proxy service from MXML,
As you can see, the named proxy simply delegates the URL details from MXML code into the server config file. This is recommended in a production environment. It helps you manage URL changes without recompiling the Flex application.
It’s still possible to use dynamic URLs in a named proxy service. In this case, the URL property serves as the default address for the destination,
If you server resides in a corporate network that must go through a proxy for out-bound traffic, add external-proxy setting to your service properties,