1

I built a Nodejs HTTP server. It's running on localhost:3000.

From outside the Local Area Network, how does one make a request to the private HTTP server? Messing with the router manually is not an option; process should be automated.

I've looked at various techniques - and I'm confused:

  1. Mapping the localhost port to the external ip address (node-nat-pmp)
  2. HTTP tunneling (node-tunnel)
  3. SOCKS (shadowsocks-nodejs)
  4. CONNECT method in request header

It seems that everything is built for a client tunneling out through a firewall, I want to tunnel a request in through the firewall and to a private server. Or just run the localhost port on the external ip.

Any help would be appreciated. Confused.

tim-montague
  • 16,217
  • 5
  • 62
  • 51
  • 1
    This has nothing to do with node really. It's the same as running a private server on any web technology. Do what you'd do if you were using Apache. Probably get your ISP to assign you a constant IP address, get the domain to point to it (set the DNS), and connect the computer directly to the internet. That would be the 'easiest'. – Benjamin Gruenbaum Jun 21 '13 at 21:52
  • I've never run a private server that needed access from the WAN. A constant/dynamic IP address is not my issue, I can ping the external ip without a problem. – tim-montague Jun 21 '13 at 22:08

1 Answers1

1

If you need to access an internal service from outside of your network, you typically have two options:

  1. Configure Port Forwarding on your router - You mentioned this isn't a possibility
  2. Use UPnP to ask your router to open a port for you - This is often disabled as it is a security risk, but if not, look into https://github.com/TooTallNate/node-nat-pmp
SpenserJ
  • 802
  • 5
  • 13
  • Unfortunately, the router that I'm using doesn't support NAT-PMP, only NAT-UPNP. However, thank you for pointing me in the right direction. – tim-montague Jun 22 '13 at 06:39