Behind-a-router help

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

Moderators: Lapo, Bax

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

Behind-a-router help

Postby Lapo » 28 Feb 2006, 07:37

Hello,
since the most asked question is "how do I connect when I am behind a router" here's a quick guide to solve the most common issues for this type of configuration.

The typical scenario is this: a local network with any numbers of computers and a router (usually with IP -> 192.168.0.1 or similar). All PCs share the same internet connection through the router.

In this case you will need a few extra steps to make your multiplayer games and applications reachable from outside. This is not due to SmartFoxServer and the following instructions are valid for any other server applications.

1- Install SmartFoxServer (Lite/Basic/PRO) on one of the machines inside the LAN

2- Set the IP address of the server in the config.xml to the LAN IP of the machine (ex. 192.168.0.16)

3- Now it's time to configure your router. Outside of your LAN nobody knows the addresses of your computers in the network as they use local addresses. In other words, from outside, the only available "entry point" is your router which is assigned an IP address.

You should configure the NAT service (Network Address Translator) of your router so that all requests on port 9339 (SFS default port) are redirected the computer running SmartFoxServer (in our example the IP is 192.168.0.16)

4- Finally you should point your SWF to the public web address of your router. If you're unsure about what this IP address is, you can use this website --> http://www.whatismyip.com/

5- Don't forget the crossdomain policy file: make sure you turn on the <AutoSendPolicyFile> function of the server (Basic/PRO only)

You can learn more about it here --> http://www.smartfoxserver.com/docs/docP ... basics.htm

If you need more help about NAT and port forwarding, check this website: http://www.portforward.com/
Last edited by Lapo on 27 Mar 2007, 12:53, edited 1 time in total.
Lapo
--
gotoAndPlay()
...addicted to flash games
User avatar
goodguy20k
Posts: 71
Joined: 10 Jan 2006, 23:58
Location: Texas, USA
Contact:

Postby goodguy20k » 28 Feb 2006, 14:11

Perfect! Thanks. That'll hopefully help the beginners.
acoole
Posts: 23
Joined: 05 Aug 2006, 21:32

Postby acoole » 06 Aug 2006, 08:07

goodguy20k wrote:Perfect! Thanks. That'll hopefully help the beginners.
Helped me but if you wanna change your routurs port theres a program called NetworkMagic(networkmagic.com)That does it for you :D
DannoD09G
Posts: 3
Joined: 11 Jan 2007, 18:36

Cross Domain

Postby DannoD09G » 17 Jan 2007, 03:24

In this scenerio, where would the crossdomain.xml need to be placed?
User avatar
Lapo
Site Admin
Posts: 21065
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 17 Jan 2007, 07:40

the crossdomain.xml always needs to be placed in the root folder of your webserver.
SmartFoxServer PRO 1.5 already comes with an embedded web server, plus it can send the policy file directly to your SWF files through sockets.
Check the chapter 3.1 of our docs for more info --> http://www.smartfoxserver.com/docs/
Lapo

--

gotoAndPlay()

...addicted to flash games
Shane
Posts: 4
Joined: 09 Jun 2007, 20:46

Postby Shane » 12 Jun 2007, 02:49

Definitly Keep in mind this:

- Set the IP address of the server in the config.xml to the LAN IP of the machine (ex. 192.168.0.16)

Also, for router setting purposes, SmartFox opperates on the default port of 9336, on a TCP connection
User avatar
Lapo
Site Admin
Posts: 21065
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 12 Jun 2007, 07:34

Thanks Shane, however the default port is 9339
Lapo

--

gotoAndPlay()

...addicted to flash games
Guest
Posts: 11
Joined: 25 Jul 2007, 06:06

Postby Guest » 25 Jul 2007, 06:48

So I did everything in those steps with the lobby example that came with the SmartFoxBits and it works when I run it locally, otherwise the connection fails. And I think that I may have screwed up the cross domain policy file (I was unsure if I need to add the crossdomain.xml in addition to the second basic/pro method described in the documention or where exactly I would add that file), or I might have screwed up something else because I really have no idea what I am doing. :)

Edit: Ok, So I looked on gotoandplay and it seems like I am having the same problem as this

mistermind wrote:Ohhhhh i think i know what is wrong. and this is probably the same problem xombie is having.
We are tryin to connect to SFS from a website to a home connection tryin only to specify the actual IP on the XML file and SWF, but that will not work for sure. the XML have to be on the web_root of the computer where the SmartFoxServer is installed, but in order to have a web_root u have to have a web server runnin (Apache, IIS, etc..)
Well, in simple words: if u wanna make a test of ur application, u HAVE to have a web server with SFS installed OR learn to install and configure a web server at ur home (search for PWS on the internet. It is a basic version of IIS for home use. Very simple and easy to use).
Thanks for the attention anyway Lapo. Im lookin foward to the SFS Basic.


http://www.gotoandplay.it/_forums/viewtopic.php?t=742

Anyway, it's been like three years since then and from what I've seen it seems like sfs now comes with a webserver (what with the webserver directory and all). But the problem is I have no idea what to do with this. Is there any documentation on this?

Edit: Ok so I found the documentation, and I enabled the webserver, the little 127.0.0.1:8080 test worked fine. I edited the crossdomain.xml in root to point to where my swf is (I hope I did it right) But I can't figure out for myself what the next step would be, as the connection still is failing.

Edit: Some more reading and I see talking about installing sfs on a webserver. I am confused.
cryptickilla4f
Posts: 4
Joined: 07 Aug 2007, 17:06

trying to get started

Postby cryptickilla4f » 07 Aug 2007, 20:11

Hi I have gotten support for my dlink router and have successfully opened ports and forwarded ports.
I am now able to access my sfs server through the admintools.swf using my network address..
my config files hold these settings
<ServerIP>192.168.0.100</ServerIP>
<ServerPort>8080</ServerPort>
I still can not access the sfs server through the internet
i.e 127.0.0.1:8080
gutnar
Posts: 2
Joined: 22 Feb 2008, 22:19
Location: Estonia

Re: Behind-a-router help

Postby gutnar » 23 Feb 2008, 06:28

Lapo wrote:4- Finally you should point your SWF to the public web address of your router. If you're unsure about what this IP address is, you can use this website --> http://www.whatismyip.com/

What does this exactly mean?

And why does my ip from
whatismyip.com
open up my speedtouch configuration
grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

behind a router.

Postby grimmy » 28 Feb 2008, 22:25

So I've spent the best part of a day searching through these forums and switching the ips in my swf, the config file and playing with the router services..and just about every combination in between but the best I get is to connnect to my chat room locally.(ie setting the ip address in the swf to point at 127.0.0.1)

As well as reading the documentation thouroughly I have tried seemingly all the steps in this and other forums. I am clearly not doing something right.

So...could someone please clearly define the steps to get the chatroom working on BOTH my local computer for testing AND accessable for others from outside my router...because surely that's the point of this whole thing right?

1.the ip of my pc this side of the firewall (eg 192,168,0,2)
Where does that go? the swf, the config or both??

2. the ip of my adsl router. The one the world sees for my PC (found at http://www.whatismyip.com/ . WHere does that go???the swf, the config or both.

3. the port number??? how do I know that its 9339? in my firewall settings (xp)I have a list of services but dont have any options to change port settings. Which services should I allow and to which IP ??? None of my services have that port. My web services port for example seems to be 80...should I allow access to this perhaps?

So, Iyou seee that I actually tried all of this stuff in every possible combination apart from the correct one to make the thing work from the inside AND the outside.

I should say how really good that smartfox seems in every other respect so far though. :)


Cheers in advance.
User avatar
csharpjava
Posts: 16
Joined: 23 Feb 2008, 03:20

Postby csharpjava » 13 Mar 2008, 12:43

i think it would be wise to make sure you've performed some pre-setup steps in #1 first b4 continuing if it doesn't work


for instance, i had forgotten to add the API in my flash publish settings and that's why nothing would work for me at first. it had nothing to do with the router problems :wink:
gutnar
Posts: 2
Joined: 22 Feb 2008, 22:19
Location: Estonia

Postby gutnar » 09 Apr 2008, 17:43

I got it working, i was opening the ports wrongly :)
BoG
Posts: 1
Joined: 06 Oct 2009, 20:17

Postby BoG » 06 Oct 2009, 20:28

edit:

a tipp for all the other noobs out there:

At step 4:

this folder here:
"C:\SmartFoxServerPRO\Examples"

is not this folder:

"C:\SmartFoxServerPRO\Server\webserver\webapps\root\Examples"
xrayblaze67CPSFS
Posts: 20
Joined: 06 Mar 2010, 16:21

Postby xrayblaze67CPSFS » 09 Apr 2010, 17:19

Lol, Im confused, I dont know how do do that, any help?

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 20 guests