I've noticed that os.hostname() is used to populate the via header's "received-by" section rather than the incoming request url host domain, port. I might be misinterpreting the spec here but I thought the intent of via was to specify the host dns name used to reach the proxy server rather than proxy host machine name.
Consider the following scenario:
I have two dns names pointing to my node webserver which uses node-proxy-middleware
- customer1.webserver.com -> my-webserver-ip
- customer2.webserver.com -> my-webserver-ip
if my-webserver-ip uses proxy-middleware to proxy "/api" to "http://my-appserver/api", then my-appserver should be able to use the via header to figure out if the request came via customer1.webserver.com or customer2.webserver.com.
I understand that the preserveHost flag can be used but becoming blind to the proxy shouldn't be necessary.
I can create a PR for this if desired.
I've noticed that os.hostname() is used to populate the via header's "received-by" section rather than the incoming request url host domain, port. I might be misinterpreting the spec here but I thought the intent of via was to specify the host dns name used to reach the proxy server rather than proxy host machine name.
Consider the following scenario:
I have two dns names pointing to my node webserver which uses node-proxy-middleware
if my-webserver-ip uses proxy-middleware to proxy "/api" to "http://my-appserver/api", then my-appserver should be able to use the via header to figure out if the request came via customer1.webserver.com or customer2.webserver.com.
I understand that the preserveHost flag can be used but becoming blind to the proxy shouldn't be necessary.
I can create a PR for this if desired.