crossdomain.xml / AllowedDomain setup

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Rashomon
Posts: 72
Joined: 11 Aug 2010, 19:48

crossdomain.xml / AllowedDomain setup

Postby Rashomon » 25 Oct 2011, 15:31

(I'm working with Flash/AS3 & SFSPro, and trying to integrate with Facebook)

I'm getting the following error when the swf loads:

Warning: Timeout on xmlsocket://12.345.6.789:843 (at 3 seconds) while waiting for socket policy file.
This should not cause any problems, but see http://www.adobe.com/go/strict_policy_files for an explanation.


I've read the SFSPro tutorials and the forum, but I'm still confused. I must be missing something.

I'm hosting my swf file on a secure SSL domain at https://www.myflashsite.gov/myswf.swf
(Could the .gov or https be causing a problem?)

My SFS server is just an IP address: 12.345.6.789
Server file structure: /insts/sofx/SFS/SFS_PRO_1.6.6 (/Server, /sfsExtensions, etc)

I'm connecting to my swf via 12.345.6.789:80. Why does my warning say port 843? Is that because I'm coming in through Facebook?

I've tried updating my config.xml file:

Code: Select all

<AutoSendPolicyFile>true</AutoSendPolicyFile>
   <PolicyAllowedDomains>
      <AllowedDomain>*</AllowedDomain>
</PolicyAllowedDomains>

No luck.

I've also tried the crossdomain.xml file:

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
   <allow-access-from domain="*" />
</cross-domain-policy>


I'm not sure where it should go, though. I put it in both https://www.myflashsite.com/crossdomain.xml (client) and /insts/sofx/SFS/SFS_PRO_1.6.6/crossdomain.xml (server). I've also tried it with setting AutoSendPolicyFile to true and false. No luck no matter what I've tried.

Do I need some actionscript to force load the crossdomain file? I found one post where the guy said he needed to do:

Code: Select all

System.security.loadPolicyFile("xmlsocket://ipaddress:9339")

I didn't see this mentioned in the SFS docs, though.

What am I doing wrong?
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 25 Oct 2011, 23:05

I'm no expert on this, but assuming that your cross policy file is located on https://www.myflashsite.com/crossdomain.xml, try placing the following code in your swf:

Code: Select all

System.security.loadPolicyFile("https://www.myflashsite.com/crossdomain.xml");
Smartfox's forum is my daily newspaper.
Rashomon
Posts: 72
Joined: 11 Aug 2010, 19:48

Postby Rashomon » 28 Oct 2011, 12:32

It turns out that I was actually getting the cross-domain info (from the config file) just fine. The problem was that my server has port 843 closed.

Flash listens for the crossdomain.xml on port 843. If it can't find it after 3 seconds, it logs a warning (which was what I was seeing), then it listens on port 80.

This wasn't a problem when I was developing. Since I was manually entering a login ID and pressing the button, 3 seconds had always passed, and Flash was able to find the policy file on port 80. When I moved it to Facebook, however, the login call was made immediately. Flash did not have time to retrieve the policy file from port 80, so my login failed.

I talked to my server guy. Here's what he said:

One of the points Matt mentioned is even if we open that particular port how would you ensure the scores of people accessing this game from their schools, libraries or even people internal to OurCompany will have connectivity on the port. Let me explain, in order for traffic to flow on port 843 from the browser to the smart fox server, the users ISP also has to allow for that traffic to pass outbound from the users browser. It is possible that several users would not be able to run it, is that risk acceptable ?


Does this sound accurate? Is it very common for ISPs to block traffic on port 843? I'm surprised this would happen, since it's a Flash standard.

I have a workaround, which is to force a 3-second delay before the login, but I'd rather not do that, if I can avoid it.
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 29 Oct 2011, 02:57

Maybe this will answer your question?

http://stackoverflow.com/questions/7931 ... rts-closed
Smartfox's forum is my daily newspaper.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 39 guests