質問

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.

役に立ちましたか?

解決

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
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top