Connecting to my server from another computer

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

Moderators: Lapo, Bax

Post Reply
TreeTree
Posts: 12
Joined: 28 May 2010, 00:22

Connecting to my server from another computer

Post by TreeTree »

I'm starting my SmartFoxServer on my desktop computer at home and I'm using Flash AS3 with it but I just can't find out how to connect to the server from another computer. The server IP in my config.xml is * and I have in Flash smartFox.connect ("127.0.0.1", 9339). Works just fine from my computer except when I log in the server says room join error: user is already in the room but that's not the problem at hand.

I've searched and read about 10 threads about connecting and all the documentation suggested but the problem is I don't really know much about servers and real time live programs. My desktop's IP is 192.168.0.2, I changed the * to that and the server couldn't assign that so I kept it as * as suggested. I changed 127.0.0.1 to my desktop's IP and I got no connection from the Flash program. I uploaded the program to superawesomecool.uphero.com and my friend couldn't get a connection from his home computer and neither could the 2 laptops I have in my home. I also stuck the swf on a flash drive and tried it on the laptops and that didn't work either.

I read the documentations but it didn't make much sense because I've only been programming for local purposes like single player games. I don't have a lot of server and network programming experience so a lot of the terms I don't understand.
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

In order for other computers (outside your network) to connect to your smartfox server, they'll need to connect using your server's external ip address - use www.whatismyip.com to get external ip address for you computer. You set this in your flash application.

Just to clarify, the ip address in your config.xml file should always be set to your server's local ip address.
Smartfox's forum is my daily newspaper.
TreeTree
Posts: 12
Joined: 28 May 2010, 00:22

Post by TreeTree »

So I have to change smartFox.connect ("the ip from that website", 9339) and the * in config.xml to 192.168.0.2 which I got from ipconfig in the command prompt.

I did this and the server started with the 192.168.0.2 address but my flash application wasn't able to connect from my own computer. I ran it about 5 times and 4 out of 5 times nothing happened but the 1 time is displayed

Code: Select all

[ Send ]: sfsHttp=connect
Error opening URL 'http://72.39.213.49:8080/BlueBox/HttpBox.do'
HttpError
[/code]
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Post by BigFIsh »

Are you behind a router? If so, you'll need to set up port forwarding and ensure your firewall isn't blocking the socket channel or bluebox port.

Nevetheless, you can use 127.0.0.1 to connect to your server locally. Other computers will need to use external ip address to connect to the same server.
Smartfox's forum is my daily newspaper.
TreeTree
Posts: 12
Joined: 28 May 2010, 00:22

Post by TreeTree »

Awesome! It seems to be working now. Port forwarded and firewall unblocked, I can connect from a laptop and from my friend's computer. Thanks a lot!
Post Reply