BLACKISH DEV BLOG Support
 

 

Unity Webplayer: crossdomain.xml

In preparing for the deployment of the very first beta of the next game as a webplayer, I’ve run into a few troubles with webplayer security policies, so here’s how to do it right so it will work in the Editor and in the webplayer:

In Edit>Project Settings>Editor enter the location where your final webplayer file will be deployed.
Create a crossdomain.xml file as described here in the docs
(Now comes the part where I went wrong) The unity docs only give the following example:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="*"/>
</cross-domain-policy>

Now this allows access from any domain, what if you want to restrict it? My mistake was to include http:// with the domain, here’s an example that works:
<?xml version="1.0"?>
<cross-domain-policy>
<allow-access-from domain="beta.blackish.at"/>
<allow-access-from domain="*.blackish-games.com"/>
</cross-domain-policy>

The crossdomain.xml file has to be placed at the root of your server and I haven’t found a way to access a subdomain yet. If you know how to do that, please let me know!
Bookmark the permalink. Follow any comments here with the RSS feed for this post. Trackbacks are closed, but you can post a comment.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>