What to do after setting up crossdomain.xml

My game needs to get a string from a xml doc on my website. This all worked fine when the game was in standalone, but due to security reasons Webplayers are a bit more complicated.

I’ve set up my crossdomain.xml at my websites root folder and everything is working out fine. But here is the problem. I know how to get a string from xml in standalone from website. I know how to set up the crossdomain. But I don’t know how to get the value after setting up the domain.

Either I’m really stupid right now, or there is something missing in the docs.

Should the string I want to get be in the crossdomain file? Or what am I supposed to do now?

As it is now I have a crossdomain file looking like this:

<?xml version="1.0"?>

<cross-domain-policy>
<allow-access-from domain="*"secure="false"/>
</cross-domain-policy>

at:
http://WEBSITE.com/crossdomain.xml

and the string at:
http://WEBSITE.com/MasterIP.xml

How should I go about getting the string now?

My old code did this, which works on standalone:

IEnumerator GETIP(){

		WWW www = new WWW("http://WEBSITE.com/MasterIP.xml");
		while(!www.isDone)
		{
			yield return new WaitForSeconds(0.1f);
		}
		string wwwtext = ASCIIEncoding.ASCII.GetString(Encoding.Convert(Encoding.UTF8,Encoding.ASCII,www.bytes));
		Debug.Log("new xmldoc");
		XmlDocument result = new XmlDocument();
		Debug.Log("loadxml");
		try
		{
			result.LoadXml(wwwtext);
		}
		catch{}

		Debug.Log(result.InnerText.ToString());
		masterIP = result.InnerText.ToString();
		return false;
	}

It returns the IP without a problem. But when using Webplayer and crossdomain, how should I go about to fetch the IP?

First time using xml and WWW in unity so sorry if the answer is obvious.

You don’t need to do anything. When Unity detects that you try to access a domain different than your hosting domain it will automatically request the crossdomain.xml file on that foreign server. If the crossdomain is missing, somehow not formatted right or doesn’t allow access your request will fail with a security exception. Otherwise you will get the same result as in a standalong build.

If the file you want to access is hosted on the same domain as your webplayer there’s no need for a crossdomain policy since you don’t have “crossing domains”. The webplayer can access anything on the domain it’s hosted on. Of course only if the resource is actually reachable from the internet. For this you should check your server configuration (htaccess, …)