Cross domain policy

 

The crossdomain.xml file controls access rights. Normally a website can be accessed with and without the www prefix, for instance http://www.astrogenic.com and http://astrogenic.com are both okay in a web browser and will open the same website.

 

This however is not sufficient for the Flash security protocol. Let us say we have placed our StormVue NGX application and associated container web page at the following URL:

 

http://www.mysite.com/svngx/StormVueNG.html

 

The background maps are placed in a subfolder:

 

http://www.mysite.com/svngx/maps/

 

In stormvue.xml you must tell the application where it can load the maps from. Following our example above, the 100 km range map would be configured as follows:

 

<map path="http://www.mysite.com/svngx/maps/mps_100.png" range="100" />

 

Now, if you try to access StormVue NGX using http://mysite.com/svngx/StormVueNG.html (note no www in the URL) there will be an error - the application will not be able to load the map!

 

This has to do with the fact that Flash security protocol does not see http://www.mysite.com and http://mysite.com as the same web site. If StormVue NGX is accessed using the www prefix then any URLs it subsequently accesses must also have the www prefix otherwise we will have a cross domain access issue at our hands.

 

Luckily this can be fixed by using a cross domain policy file which is an XML file. In it you simply put the URLs that you want StormVueNGX to have access to. To avoid the problem described above we would edit the supplied crossdomain.xml and make it look like this:

 

<?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="mysite.com" />

      <allow-access-from domain="www.mysite.com" />

      <allow-access-from domain="*.mysite.com" />

</cross-domain-policy>

 

We then save this file and upload it to our root HTML folder on our web server. In many cases this is the folder named public_html. Once this is done there will no longer be any problems associated with accessing StormVue NGX with or without the www prefix.

 

Using this technique you could in fact enable StormVue NGX access to a completely different domain. This can be very handy if you want to publish your lightning data and StormVue NGX on separate domains.

 

A cross domain policy file is not required if StormVue NGX is configured to run locally on a PC.