By default there is a crossdomain.xml in the config folder with the following:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<!-- This is a master-policy file. site-control can be all,none,master-only -->
<site-control permitted-cross-domain-policies="all"/>
<!-- Instead of setting to-ports="*", administrators can use ranges and commas -->
<!-- This will allow access to ports 123, 456, 457, and 458 -->
<allow-access-from domain="*" to-ports="9933" />
</cross-domain-policy>
This should allow client from any domain to connect to 9933 right? When I try to connect from a unity webplayer client I get TCPSocketLayer unable to connect as no valid crossdomain policy was found.
I'm using
SmartFox sf = new SmartFox(true) // debug set to true
sf.Connect("127.0.0.1", 9933);
I'm either opening the html as a local file:// or loading it from SFS2X's webserver from http://localhost:8080. I have also tried to connect to a remote IP where I've replicated my local setup, in all cases I get this cross domain error.
crossdomain.xml
Yep, but it's not necessary to open a new port.
You can use the Security.PrefetchSocketPolicy() to force the webplayer into loading the policy from the port where you will connect to (e.g. 9933)
This is mentioned in the Unity manuals "Security Sandbox on the webplayer 3.0" page
The method should be called right before connecting to SFS
cheers
You can use the Security.PrefetchSocketPolicy() to force the webplayer into loading the policy from the port where you will connect to (e.g. 9933)
This is mentioned in the Unity manuals "Security Sandbox on the webplayer 3.0" page
The method should be called right before connecting to SFS
cheers