How to reverse proxy to local server without incoming ports opened using node.js

1.3k views Asked by At

I have a local web server which has only outgoing internet access. I have a public server on the cloud, which cannot access my local web server directly.

I want to find a way to have my local web server connected to the public server, and for the public server to act as a reverse proxy to forward web request to my local web server, and return the response to the public server.

I have been looking at node-http-proxy to try use a public server to forward http request to another local web server which has no incoming ports opened. But it seems that node-http-proxy assumes that the reverse proxy server has access to the local network.

Is there any solution out there?

Thanks.

1

There are 1 answers

0
Joe On

A proxy generally is fronting a set of connections. What you are really asking here is how to make requests of a private webserver without being able to initiate communications with it. Given the naturw of HTTP I'm not sure a thing exists.

You could try addressing this with a secure tunnel (openVPN or stunnel etc. ) where you establish a link between servers from "inside out" but then make connections in the expected direction over that link. But you are basically opening up that protected server to that host which may be more exposure than what you want.