Page 1 of 1

Connecting from outside and inside at the same time.

Posted: 29 Feb 2008, 09:51
by grimmy
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

Posted: 29 Feb 2008, 10:07
by Bax

Posted: 29 Feb 2008, 15:26
by grimmy
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. :(

Posted: 29 Feb 2008, 16:29
by Lapo
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

Posted: 29 Feb 2008, 17:43
by grimmy
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.

Posted: 01 Mar 2008, 18:16
by grimmy
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.

Posted: 01 Mar 2008, 20:01
by xxxxxxss
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.

Posted: 02 Mar 2008, 01:06
by grimmy
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.

Posted: 02 Mar 2008, 03:42
by BigFIsh
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)