Connecting from outside and inside at the same time.

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

Moderators: Lapo, Bax

grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

Connecting from outside and inside at the same time.

Postby grimmy » 29 Feb 2008, 09:51

So it it actually possible to connect to my game from the same computer that the server is running from and allow people from outside my intranat to access it too?
if so, which ip should the actionscript point to? My pc's local ip or the routers ip? I've tried both but none seem to work.
Cheers
User avatar
Bax
Site Admin
Posts: 4482
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Postby Bax » 29 Feb 2008, 10:07

Paolo Bax
The SmartFoxServer Team
grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

Postby grimmy » 29 Feb 2008, 15:26

Yes. I've checked it ,tried it and tried seemingly every variation of it, but can only connect from either inside or out but not both. :(
User avatar
Lapo
Site Admin
Posts: 21139
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 29 Feb 2008, 16:29

Can you be more specific and explain what steps you have done?
Did you configure the firewall?
Did you setup the NAT?

If you're using SFS 1.5.9 or later it's not important the IP in the config.xml you can leave 127.0.0.1. The server auto-binds all available IP addresses
Lapo
--
gotoAndPlay()
...addicted to flash games
grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

Postby grimmy » 29 Feb 2008, 17:43

Ive tried lots but my current settings are as follows..

1. I have set my actionscript .swf to point at my external ip address(the one found at www.whatsmyip.com) as seen from the outside and to port 9339.

1b. i also added the line System.security.loadPolicyFile("xmlsocket://192.168.0.2:9339") to the swf.

2. My config file currently points at 192.168.0.2 (which is my pc inside the router and the same place as Smartfox is running from) port 9339.

3. My router is of the netgear variety and I went into the software and set up a custom service called smartfox which has a start port of 9339 and an end port of 9339. I then set up this service to 'allow always' (in and out) and with the inbound service I set it point at my PC's IP address (192.168.0.2).

4. As a bonus :) I went into my windows XP firewall setting and added a new service called smartfox on 192.168.0.2 (port 9339) and tacked it which apparently then enables internet users to access.

5.once all this is done I upload my webpage containing the swf to my host and then try to connect.

note: when testing the published swf in flash I get the following message Error opening URL 'http://81.152.75.xxx:8080/BlueBox/HttpBox.do'

..hope that helps. cheers.
grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

Postby grimmy » 01 Mar 2008, 18:16

So the position I'm in now is that everyone from outside can access my application on my server except me because I'm on the samne PC as the server.
Is that right? Surely not.
xxxxxxss
Posts: 9
Joined: 27 Feb 2008, 04:34

Postby xxxxxxss » 01 Mar 2008, 20:01

It is possiable but you cant connect to the web page on what the swf is hosted on. Just make another fla and change your what is my ip ip to your computers ip address in ipconfig/all and then test the movie and you should beable to connect with the server and talk to people who got on on your web page.
grimmy
Posts: 7
Joined: 28 Feb 2008, 12:35

Postby grimmy » 02 Mar 2008, 01:06

Thats it! Thanks very much.

So to be clear for others-

To connect to the application from the pc with the server on it I need to run a separate .swf that points at the local ip.

For everyone on the outside they will run a slightly different .swf which is placed on a web page which within points to my router .

..so 2 swfs are connecting to 1 sever simultaniously.

(previously I was trying to connect from my pc to the webpage with the swf..which would then refer me back to my pc with the server on... This doesnt work.)

Hopefully this might help someone else.

Thanks all.
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 02 Mar 2008, 03:42

grimmy wrote:Thats it! Thanks very much.

So to be clear for others-

To connect to the application from the pc with the server on it I need to run a separate .swf that points at the local ip.

For everyone on the outside they will run a slightly different .swf which is placed on a web page which within points to my router .

..so 2 swfs are connecting to 1 sever simultaniously.

(previously I was trying to connect from my pc to the webpage with the swf..which would then refer me back to my pc with the server on... This doesnt work.)

Hopefully this might help someone else.

Thanks all.



Ahh, so that was the problem!! This helped me alot. By the way, there is another alternative to this - I was able to run the swf file from my laptop, which also runs the server, with firefox. I couldn't view it on Internet Explorer.. but now I can (using the method described above)

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 22 guests