http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Proxy all requests, not just unhandled ones

Open thany opened this issue 10 months ago • 1 comments

What's the problem this feature will solve?

I just need a quick forward proxy server, so that I can use my phone to reach a website that is running on my pc locally. I can't reach that local website directly from my phone, because it would require changing the hosts file, which is not possible on mobile.

I also can't change the hostname requirement on this local website, because it requires an impractical amount of time to do so. Not something we're proud of, but it is what it is, for the moment.

Describe the solution you'd like

I would like to be able to execute something like

http-server --proxy http://website.local/ --proxy.all true

Or something. So that opening http://<ipaddress>:8080 doesn't initially show a directory listing of where this command happened to have been executed, but instead shows the website being proxied.

Basically this means it would disable static file serving completely, iyam.

Alternative Solutions

I guess firing up an apache server and doing whatall configuration to get it to work that way, could be an alternative solution, but not one that is very portable and/or easily runnable through a package.json script.

I've looked at a few other static file serving packages, but they don't appear to support forward proxying at all, unless I overlooked something. So my hope remains with this one.

thany avatar Jan 23 '25 15:01 thany

I need this too. I was shocked there isn't a way to do this and more shocked to see someone asking for it just 2 weeks ago. I've been using this library for years, but never needed it to be a pure proxy until now. Hope this can be added.

itslenny avatar Feb 05 '25 22:02 itslenny

This issue has been inactive for 180 days

github-actions[bot] avatar Aug 05 '25 12:08 github-actions[bot]

added it

KernelDeimos avatar Nov 08 '25 22:11 KernelDeimos