Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

can i force connecting to local web server via internet network ?  RSS feed

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all
this is general question , if i have web server installed in my local pc and i have client that connecting to that web server
can i force it always to go via the internet network ?
the reason im asking is .. that im noticed when i close my internet connection i still can connect to my web server.
 
Chris Janicki
Greenhorn
Posts: 23
Mac OS X Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can point your client to the publicly addressable IP address assigned to your router when you connect to the Internet. This address is known to your DSL/Cable router. Your PC does not know the external IP address. The router is translating between your public Internet address and the local IP address of your PC... this is called Network Address Translation (NAT). You should read about this on the web (e.g. Wikipedia).

Once you know your public IP address, you have to configure your router to allow incoming traffic (your client's request to the web server port 80) to be directed to your PC's local address (usually 192.168.1.x, but sometimes different). Usually NAT blocks all incoming requests. Depending on your ISP, they may not let you access that part of your router's configuration? (I think you can buy your own router or just google for the password) The configuration you need to do is called "port forwarding"

Routers usually let you redirect a single port to a single PC, or alternatively direct all ports to one PC (sometimes called "DMZ host")

WARNING: The NAT is a firewall protecting your PC from external hackers. Be aware of which ports your are exposing, and be careful. Make sure your web server is up-to-date with security patches.

If you have dial-up, then I think it is much easier... no NAT firewall? You can run "ipconfig" from a DOS window to find your IP assigned to the modem. This is your public address. However, I don't know if the ISP will send inbound requests through to you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!