Stardog
September 4, 2011, 8:05pm
1
I have crossdomain.xml in the root of my server, but I still get this error.
SecurityException: No valid crossdomain policy available to allow access
UnityEngine.WWW.get_text () (at C:/BuildAgent/work/f724c1acfee760b6/Runtime/ExportGenerated/Editor/Utils.cs:96)
LoginScriptJS+$doLogin$4+$.MoveNext () (at Assets/_Scripts/Managers/GameManager/LoginScriptJS.js:51)
I can access the file fine. I even CHMOD’d it to 777. I’ve tried on a local server and a paid server with a .com domain.
Is there no override for it while I’m just trying to test a small amount of code? What a pain…
i found the solution. just go to edit>project settings>editor> the change the default host url to your own host url, host url means your sever url. it will work even without the crossdomain.xml file
<?xml version="1.0" ?>
<cross-domain-policy>
<allow-access-from domain="*.yourdomain.com" />
</cross-domain-policy>
have you tried it when specifying the top and sublevel domain?
can you access the file from a normal browser on the real url? like: yourdomain.com is available for purchase - Sedo.com
if you CAN’T download it from a normal browser, you have a webserver READ access problem, not a crossdomain.xml problem, I think.
You could also try to add localhost as an allowed domain for local testing:
<allow-access-from domain="localhost" />
It should be
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>
note domain=“*”
as stated in the docs . I had the same problem until I tried that.
jahroy
September 12, 2011, 9:14pm
4
Try opening and saving the file on the server with vi.
That’s the only way I was able to get mine to work…
ssh to server
open crossdomain.xml with vi
save file
enjoy
To open a file named crossdomain.xml with vi, type the following at the command line:
vi crossdomain.xml
To save it, type the following:
ZZ
(that’s capital ‘Z’ two times)
Note you can substitute the editor of your choice.
The whole point of opening and saving is to make sure the encoding is suitable.
Make sure you are saving the file in UTF8 without BOM (Byte Order Mark)
system
March 16, 2012, 2:21pm
6
I had a similar issue, and what fixed it was I had to specify the port on my unity URL request.
url = “http://192.168.19.129:80/ ”; Leaving the port 80 off, resulted in just getting crossdomain policy errors.
If anyone is having this issue on IIS, note that the crossdomain.xml file needs to be in the root folder of the IIS website, not in the root folder of any virtual directory or application.
If you are getting this error from connecting with a socket, then it is not an http request for crossdomain.xml sent to port 80, but rather a raw tcp (telnet) request sent to port 843. You can use something like nc or netcat to serve the policy as ascii on port 843 and test it with:
/> telnet localhost 843
And also I had to do in Unity:
Security.PrefetchSocketPolicy("mydomain.com", 843);
before connecting my socket