- Home /
WWW No valid crossdomain policy available to allow access
I'm basically getting the following error:
SecurityException: No valid crossdomain policy available to allow access
UnityEngine.WWW.get_text () (at C:/BuildAgent/work/d3d49558e4d408f4/artifacts/EditorGenerated/Utils.cs:171)
DataHandler.GetChannelProperty (System.String property) (at Assets/Scripts/DataScripts/DataHandler.cs:21)
GameMaster.Start () (at Assets/Scripts/GameScripts/GameMaster.cs:28)
Which is resulted by the following scripts. It's worth noting that i'm exporting to Unity Webplayer.
DataHandler:
using UnityEngine;
using System.Collections;
public class DataHandler : MonoBehaviour {
public static DataHandler self;
void Awake() {
self = this;
}
public string GetChannelProperty(string property) {
int channelID = 6;
string urlRequest = "HIDDEN FOR MY SECURITY PURPOSE";
WWW request = new WWW(urlRequest);
StartCoroutine(YieldRequest(request));
while(!request.isDone) {}
return request.text;
}
private IEnumerator YieldRequest(WWW request) {
yield return request;
}
}
GameMaster:
.....
void Start() {
ChannelName = DataHandler.self.GetChannelProperty("channel_name");
}
.....
This sounds pretty duh, but are you sure you DO have a valid crossdomain policy?
And use the full http url, not just a relative path.
For example purposes, I am using this path "http://website.com/game/getproperty.aspx?property=channel_name"
This works in the actual browser on my real url.
Never$$anonymous$$d, just found out what the wiki told me of WWW.. It didn't say anything about having an external file thats names crossdomain.xml and filling it with some access point. I did that now, it's all fixed and works (y)
@dkfister - you read the documentation and fixed the wiki for the next person right?
Your answer
Follow this Question
Related Questions
WWW Request runs in Editor but not in Webplayer 1 Answer
Multiple Cars not working 1 Answer
Yield return request never returns 0 Answers
Distribute terrain in zones 3 Answers
Cannot get a class to show up correctly in a custom inspector 0 Answers