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

Request proxying of custom HTTP headers

Open tammingaj opened this issue 5 years ago • 5 comments

Steps to reproduce the issue, if applicable. Include the actual command and output and/or stack trace.

  1. Start http-server with the -P parameter pointing to a backend server that is reachable.
  2. Send a request, containing a custom HTTP header, to http-server that should be proxied to the configured server.

What did you expect to happen? I expect the custom HTTP header to be available in the request as it is received in the backend server.

If the issue is a feature request, what is the motivation / use case for it? I use http-server to run a development version of my Angular web application. The application needs data from a REST endpoint that requires a custom HTTP header to be present.

Tell us about your environment

  • **exact http-server version:**0.12.3
  • **Node version:**8.10.0
  • **Platform:**Windows 10

tammingaj avatar Sep 08 '20 09:09 tammingaj

👍

nilsdjupvik avatar Sep 10 '20 10:09 nilsdjupvik

Another scenario is to set proxy headers such as "X-Forwarded-For" / "X-Forwarded-Proto" ... to give the back end server hints about the public URL.

cor3000 avatar Oct 21 '20 04:10 cor3000

This issue has been inactive for 180 days

github-actions[bot] avatar Aug 17 '21 12:08 github-actions[bot]

I'd consider this a breach of the principle of least astonishment, request headers should be forwarded

thornjad avatar Aug 17 '21 13:08 thornjad

This issue has been inactive for 180 days

github-actions[bot] avatar Apr 12 '22 12:04 github-actions[bot]