Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What I have

I have a Tomcat 7.0 server running on my Windows 7 PC and I have a dial up internet connection. IP I get on whatismyip is 117.xxx.xxx.xxx. I want to use this machine to test my Android Application.

I access the servlets on my Apache Tomcat 7 via Android Emulator through

http://10.0.2.2:8084/MyServer

I want to access the Server via my real Android Device.


What I did

  • I'm using No-IP Free to covert my dynamic IP (I have a dial-up connection) to a static IP.
  • I changed the Inbound Rules for port 8084 on my Windows 7 firewall, but it did not work.
  • As suggested by @slhck I have been able to access my router and did Advanced Setup » NAT » Virtual Server Setup and on this screen,

    I added TCP, external and internal port both 8084, internal server set to 10.0.2.2. The "Service Name" - "Tomcat".

share|improve this question
    
@slhck We are not on the same network. I want to connect to my computer from outside. –  Gaurav Agarwal May 18 '12 at 13:44
    
@slhck Hey, Thanks it worked I changed 10.0.2.2 to 127.0.0.1. This [Wiki]en.wikipedia.org/wiki/Localhost helped. –  Gaurav Agarwal May 18 '12 at 20:04
    
Hm.. 127.0.0.1 is always the address of your own computer. I don't think you put 127.0.0.1 into your Android device and it worked? –  slhck May 18 '12 at 20:21
    
So you had to put in 127.0.0.1 in your router? –  slhck May 18 '12 at 20:26
    
I did so — you just forgot one comment above :) –  slhck May 18 '12 at 20:32

1 Answer 1

up vote 1 down vote accepted

Firewall rules on your Windows PC and wired/wireless router will both need to allow incoming connections to port 8084.

On the router, set up incoming connections to 8084 to redirect to your Windows PC's local IP address (127.0.0.1). This is called "port forwarding" – look into your router's manual on how to do it.

Once your router forwards incoming port 8084 requests to your Windows machine, you can access it from the outside:

http://your-dynamic-address.com:8084/MyServer
share|improve this answer
    
I am very new to all this. Can you please explain how to go about doing what you have proposed? –  Gaurav Agarwal May 18 '12 at 13:44
    
@blackcrow I added a little to Ali's answer. Port forwarding should be supported in your router. Check its manual for details on how to set it up. Then, all outside requests to your Tomcat port will be forwarded to the Windows machine –  slhck May 18 '12 at 14:06
    
@slhck Thanks. I tried doing what you said. But I am still having difficulty. I have updated my question. I hope you will help. –  Gaurav Agarwal May 18 '12 at 18:04
    
@blackcrow Protocol is TCP; external and internal port are both 8084, and your internal server is obviously 10.0.2.2. As "Service Name" you can just put "Tomcat". That's all. –  slhck May 18 '12 at 18:27
    
@blackcrow Then leave out the www. I'd suggest you edit your question and add details as to what you've tried accessing and pinging – I probably can't help you any further, sorry. –  slhck May 18 '12 at 19:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.