Wednesday, 6 July 2011

Port Forwarding


A number of my Android applications (WiFi File Explorer, SECuRET LiveStream, BabyCam Monitor and GroovyCam LiveStream) all work by turning an Android device, which is connected to a local WiFi network, into a web server.  This then allows you to connect to it via a web browser on that same local network in order to access the service provided by the application, i.e. file management, video & audio streaming, etc.

So that’s all good and you got it working on your local network, and you’re pretty happy with that.  But wait; now you want someone who’s not on your local network to be able to use the application as well.  For example you may want someone to view the feed from SECuRET LiveStream across the internet.  Well, thanks to ‘port forwarding’ that is entirely possible!

Now, I can’t give you exact step-by-step instructions on how to forward ports for your model of router; there are far too many models available and I simply don’t know how to do it for them all ... hey, I even have to Google up some instructions for how to do it on my router whenever I need to.  But a good place to start to find out how to do it is as http://portforward.com/

What I can do though is tell you want you need to do to accomplish your goal.  Following are some general instructions for forwarding ports on your router to allow the services in my applications to be used across the internet...

Firstly, by configuring your router, you need to forward ports 8000 and 8001 on your router to ports 8000 and 8001 of your Android device, based on the Android device’s IP address.  WiFi File Explorer only uses port 8000 and that number is configurable in the application settings, so you only need to forward this port or whatever you have it configured as.  The other applications will have the ports configurable in the future as well, so depending on when you read this, just bear that in mind.

Once that is done, all you need to do is replace the IP address part of the web URL that the application tells you to enter into your web browser, with the external IP address of your router (one way to find that out is on the main page of the Port Forward website I linked to above).  So for example, the application may tell you to enter something like...

http://192.168.0.3:8000

... where 192.168.0.3 is the IP address of the Android device.  But instead of entering that, if your router’s external IP address is for example, 82.124.321.29, then you (or whomever you want to be able to use the service) would enter...

http://82.124.321.29:8000

... and hey presto, it’s working across the internet!!  Easy huh?!

Now, I realise depending on your level of skill that may not be easy at all, so if you get confused then feel free to email me for more help.  But remember, if it’s something specific to your model of router, I’ll only be using Google to find the answer, just like you would ;)

1 comment: