Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Stardog · Sep 04, 2011 at 08:05 PM · wwwcrossdomain

crossdomain.xml - No valid crossdomain policy available

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...

Comment
Add comment · Show 5
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BerggreenDK · Sep 04, 2011 at 08:33 PM 0
Share

perhaps the format of your crossdomain file is wrong? can you post it without sharing the security?

avatar image Stardog · Sep 04, 2011 at 08:39 PM 0
Share

http://www.sendspace.com/file/38dza5 - I tried encoding to different formats using notepadd++. The docs say to make it an ASCII file, but only ANSI/UTF-8/etc were available.

I have even saved somebody elses workingfile (http://theinvestigator.net/crossdomain.xml) and uploaded that to the root.

avatar image jahroy · Sep 13, 2011 at 04:22 PM 0
Share

Try opening it with vi on the sever and saving. That solved it for me.

avatar image sotirosn · May 20, 2013 at 11:57 PM 0
Share

I was getting this error and then found, (maybe because I was using a tcp socket, not the WWW class) that it was not a http request to port 80 for this file but rather a raw tcp (telnet) request to port 843 for the ascii cross domain xml policy.

So you test it by: /> telnet hostname 843

avatar image benissimo · Mar 20, 2015 at 11:15 PM 0
Share

Could anyone supply the URL of an image on a domain which is definitely known to work? I just can't get this image loading working - tried everything - it was never this difficult in Flash :)

8 Replies

· Add your reply
  • Sort: 
avatar image
5

Answer by Eydamson · Apr 24, 2013 at 02:29 PM

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 :)

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image abhishekdeb · Mar 21, 2014 at 05:07 AM 0
Share

Thanks a lot.. THis should have been the accepted answer.

avatar image eDmitriy · May 12, 2014 at 05:08 PM 0
Share

Thank you, it's work!

avatar image
1

Answer by BerggreenDK · Sep 04, 2011 at 08:48 PM

 <?xml version="1.0" ?> 
 <cross-domain-policy> 
     <allow-access-from domain="*.yourdomain.com" /> 
 </cross-domain-policy> 


1) have you tried it when specifying the top and sublevel domain?

2) can you access the file from a normal browser on the real url? like: http://yourdomain.com/crossdomain.xml

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" />     
Comment
Add comment · Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Stardog · Sep 04, 2011 at 09:17 PM 0
Share

1) I tried that version and the localhost one, but still not happening. 2) Yes I can access it the same as theinvestigator.net's. I have to give up for today.

avatar image BerggreenDK · Sep 12, 2011 at 08:14 PM 0
Share

if you want, you can mail me your domain in a private way and then I will see if I can open it from my location? I've just created this mail-alias: unitytest1@berggreens.dk so if it gets spammed I can remove it instantly. Feel free to contact me that way.

avatar image sotirosn · May 20, 2013 at 11:50 PM 0
Share

I have found that the cross domain policy is not requested over http but rather a raw socket. It doesn't matter where you put the policy as long as you get it is servered from port 843 as ascii text. You can test if it works by doing:

telnet yourdomain.com 843

^ I don't know why there is a http:// up there i did not write that...

avatar image
0

Answer by Leslie-Young · Sep 10, 2011 at 08:40 PM

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.

Comment
Add comment · Show 6 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BerggreenDK · Sep 11, 2011 at 09:50 PM 0
Share

if you follow his link, you can see that already has domain="*" inside it. So its not that I think.

avatar image Leslie-Young · Sep 12, 2011 at 05:41 AM 0
Share

Well, that does not make my answer incorrect cause that is what it shoud look like rather than your domain="*.yourdomain.com" which did not work for me on a google app engine hosted app.

avatar image BerggreenDK · Sep 12, 2011 at 08:11 PM 0
Share

Strange, because I run my tests on 4 different locations and they all work with *.domain.com

avatar image Leslie-Young · Sep 12, 2011 at 08:19 PM 0
Share

So if I wanted to say "*.some_domain.com" .. is that supposed to work? and what would be the difference between using "*" and "*...com" ? I'm new to this crossdomain stuff, actually found this topic while doing a search against the error message that Unity dumped and then realised from reading here that there should be docs about this.

avatar image BerggreenDK · Sep 13, 2011 at 08:21 AM 0
Share

Its not that I wont try to help you solve your problem, but doesnt this belong in a new question?

Show more comments
avatar image
0

Answer by jahroy · Sep 12, 2011 at 09:14 PM

Try opening and saving the file on the server with vi.

That's the only way I was able to get mine to work...

  1. ssh to server

  2. open crossdomain.xml with vi

  3. save file

  4. 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.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Wulfeous · Sep 16, 2011 at 05:34 AM 0
Share

I don't know how to use vi.. can anyone just post their working crossdomain to see if this is just a silly coding issue? I've tried everything else I've read on the issue for days. worked on standalone. I have "http://localhost/scores.php" as my scripts target. why is this so impossible when it says right in the docs that crossdomain.xml is not needed in local host setups?? all permissions in ftp are set to 775 atm.

avatar image jahroy · Apr 24, 2013 at 06:35 PM 0
Share

Is it really that hard to open a file and save it with vi?

I added some instructions just in case...

avatar image
0

Answer by andresp · Mar 14, 2012 at 04:20 PM

Make sure you are saving the file in UTF8 without BOM (Byte Order Mark)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

14 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

crossdomain.xml on Server Requiring Basic Authorization 0 Answers

"SecurityException: No valid crossdomain" even though the webplayer didn't even try to get the crossdomain policy request. 1 Answer

CrossDomain AllowAccessFrom * do not work 1 Answer

WWW Post doesn't work. 2 Answers

Unity Web Player Load Object Error crossdomain.xml 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges