Server-side check for what site an .swf is hosted on?

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

Moderators: Lapo, Bax

Post Reply
Ack
Posts: 9
Joined: 09 Nov 2005, 21:47

Server-side check for what site an .swf is hosted on?

Post by Ack »

Is there any way to make the SmartFox server check for what website a .swf that connects is being played from? For example, to only allow .swf's hosted on www.mysite.com to connect the the SmartFox server?

Thanks!
User avatar
Lapo
Site Admin
Posts: 23438
Joined: 21 Mar 2005, 09:50
Location: Italy

Post by Lapo »

No, not directly from SmartFoxServer.
That information can be "captured" from inside thw SWF file using the _url property

However there's a nice "trick" you can use.
In version 1.4.0 we've added a new tag: <PolicyAllowedDomains>
which allows to specify only the domains from which the swf is allowed to connect to the server.

Example:

Code: Select all

<PolicyAllowedDomains>
	<AllowedDomain>gotoandplay.it</AllowedDomain>
	<AllowedDomain>smartfoxserver.com</AllowedDomain>
</PolicyAllowedDomains>
This allows only SWFs coming from those 2 domains to connect to my server, all the others will be refused.

More infos here: http://www.smartfoxserver.com/docs/docP ... basics.htm

hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
Post Reply