Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

change "WWW Security Emulation Settings" from code

Discussion in 'Editor & General Support' started by arioch82, Aug 24, 2011.

  1. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    is it possible to setup this value from a script running in the editor or to disable the crossdomain.xml check for an editor script that does a WWW request?

    Thanks
     
  2. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    disable: yes switch to a different platform than webplayer. as long as its webplayer its impossible to disable it as it would be meaningless if you don't see it failing till post build - upload (thats how it originally worked with all the corresponding anger about the back then useless emulation)

    change it: if it is exposed in any form, its not documented
     
  3. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    even if I switch the platform the WWW request will still look for a crossdomain.xml

    my file is in the server's root folder but i keep getting a "was not found" error, if I set the editor setting to the same domain everything works fine but the domain for the WWW request is dynamic so i can't keep changing manually that setting in the editor.

    I'm doing requests with the url in the form "https://username:password@domain" and as I said everything works fine apart from the access to the crossdomain.xml file, maybe when the API try to access it it will fail without the authentication?

    any idea on how can I get this working?
     
    Last edited: Aug 24, 2011
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    how can the domain for the WWW request be dynamic? you realize that you can only talk to servers under your control, if you want to do freeform then you will not be able to use the webplayer unless your WWW access is restricted to images, cause tahts the only thing that will work without crossdomain.xml (and if used that way, all images become unreadable / unwritable)

    The username:passwort part makes sense for later access but the initial request you would best just do against http://www.domain.com so it can find the crossdomain (cause it will look on http://www.crossdomain.com:80/crossdomain.xml anyway, nowhere else), a simple request to the root domain can get it validated.
    Unsure if HTTPS adds extra steps, but if so they were so far neither mentioned nor ever reported by anyone else
     
  5. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    it's all part of a sets of editor scripts, is not something that will run in the webplayer build :)
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    it will not run in there yes. But if the project were set to webplayer then the whole code you use anywhere is under webplayer restrictions
     
  7. arioch82

    arioch82

    Joined:
    Dec 3, 2009
    Posts:
    253
    adding the "new WWW("http://domain")" did the trick, i don't need to set the security setting anymore, thanks!
     
  8. Ive

    Ive

    Joined:
    Apr 24, 2013
    Posts:
    9
    Bom, eu tenho um game hospedado em um servidor Apache (xamPP) que solicita conteudo de um webservice ASp/.NET. Coloquei o Crossdomain.xml na pasta root do servidor iis(inet/wwwroot) e finalmente FUNCIONOU!!