Cross-domain policy file

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

Moderators: Lapo, Bax

Nelagend
Posts: 9
Joined: 08 Aug 2010, 18:09

Cross-domain policy file

Postby Nelagend » 13 Sep 2011, 16:56

My apologies for this being a newbie mistake, but I haven't understood what I've found on searches properly.

I read the documentation on cross-domain policy files here, and I'm a tad confused. I am attempting to get my client, which runs fine on my own computer running the server from my own computer, to work on another computer. So far it refuses to connect, I think due to Flash security features.

I got hung up on this part: "these files are simple xml files that can be loaded from the web root of the external domain you want to access, or they can be served via socket. When you are pointing the Flash Player to a resource outside the current domain it will try to load the policy file from the web root of the external domain and see if it can access the required resource. " I'm not sure what the web root of the external domain is.

When the client is, say, C:\aeas\aeas.swf on the client computer, where am I putting that file? I put one as C:\aeas\crossdomain.xml including <allow-access-from domain="*" /> to try and tell Flash's security to stand down for now so I can run the program, but it hasn't changed anything. Do I need to have that crossdomain.xml also in the smartfoxserver directory of the host computer? At C:\ on the host laptop?
User avatar
zachofthegolden1
Posts: 89
Joined: 05 Sep 2011, 19:31

Postby zachofthegolden1 » 13 Sep 2011, 17:32

With me i port fowarded port 9339 and port fowarded port 8081 and waited 30 minutes for my outer to process it all then my game was working fine for other people

have you pointed your swf to your external ip address?

also if you are hosting it froma website make a new file called crossdomain.xml

i used this <cross-domain-policy>
<allow-access-from domain="http://ngpe.netii.net"/>
</cross-domain-policy>

so <cross-domain-policy>
<allow-access-from domain="http://yoursitehere"/>
</cross-domain-policy>

then you save your crosssomain.xml to your site then it should work
-ZG1
Nelagend
Posts: 9
Joined: 08 Aug 2010, 18:09

Postby Nelagend » 13 Sep 2011, 20:34

I'll try forwarding my ports, thanks.

The client hangs at the sfs.connect command if not run from my computer. It's not displaying what I think it would if it tried and failed to connect (assumedly what it does if I forget to start the server before the client), but instead something that indicates it's not trying in the first place.

If forwarding doesn't work and nobody has any other ideas I may just have to try and host it at a website, but that would make it harder to work on features while offline.
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 13 Sep 2011, 23:35

You'll need to host your swf on your website, unless you configured your computer to run as a dedicated web server. (Using Apache) This is a complicated process, however.

You can continue to work on your application locally, while other clients can access your 'production' game via the swf file located on your website. Then you can always upload a new version of the game when it's ready.

Both swf (locally, and externally) can access your SmartFoxServer located on your machine, providing that you have configured your IP/port correctly within both SWF files.
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 43 guests