Home » Questions » Computers [ Ask a new question ]

How do I allow a remote user to connect to a web app running on my PC?

How do I allow a remote user to connect to a web app running on my PC?

"I have created a web application in Eclipse, and a DB2 database server is running on my PC. I can access the web application through the address
http://localhost:8080/LimsWeb"

Asked by: Guest | Views: 300
Total answers/comments: 2
bert [Entry]

"Connecting from the same LAN

If your friend is on the same local network as you, it's very simple: make sure any software firewalls on your computer are configured to accept connections from remote computers on port 8080, then have your friend replace ""localhost"" in your URL with your IP address or hostname--for instance, http://192.168.1.4:8080/LimsWeb (assuming that is your IP address) or http://lims-pc:8080/LimsWeb.

Connecting over the Internet

But suppose your friend is somewhere else, and the Internet lies between you and him...then you have to do a little extra. You'll have to configure your firewall software just as you did for the LAN instructions, but you'll also need to do some additional network configuration.

Option 1: VPN

If you only want your friend to be able to connect to the web service running on your PC, the easiest solution is probably to set up a VPN. Some wireless routers have VPN support built-in (and with some others, you can install a version of DD-WRT with VPN support), but you can also use something like Hamachi or OpenVPN.

Option 2: Port forwarding/DMZ

If you have administrative privileges on your router (or know someone who does), you can also configure port forwarding or (even scarier) DMZ to allow outside computers to connect directly to your PC. As alemjerus mentioned, you can also set up a dynamic DNS service or some other DNS provider (e.g., dyndnsdotorg, no-ip.com) to point to your Internet IP, so your friend can connect more easily without having to remember your IP address. But personally, I wouldn't recommend going this route, especially not if you happen to be in a corporate environment.

Using the right hostname/IP address

But that's only half of it. As you might have already guessed, your friend won't be able to connect to your computer via the address http://localhost:8080/LimsWeb, because ""localhost"" is exactly that--the local computer. Once you settle on an appropriate mechanism to make your computer visible to his, he'll have to use your LAN IP address or hostname (if you used a VPN) or your public IP address or hostname on the Internet (if you used port forwarding or DMZ)."
bert [Entry]

"It should not be complicated. First, you can install yourself something like no-ip.com service to tell your friend your current IP, then open all the firewall/router ports for outside access, and give your friend the address you've got, like http://yourHostName.dyndnsdotorg/LimsWeb.

Another solution is to deploy your project on Web"