hpagent icon indicating copy to clipboard operation
hpagent copied to clipboard

Add support for proxyRequestOptions

Open mbargiel opened this issue 3 years ago • 0 comments

This PR adds a new property to the constructor options, proxyRequestOptions, which allows callers to provide options for the CONNECT request made against the proxy. There are various reasons to do this:

  • A custom ca may need to be passed to the proxy connection but not the upstream connection (or vice versa) and the ca value is not known at launch or can change over time, preventing the use of NODE_EXTRA_CA_CERTS as a viable alternative because that environment variable is only used by Node during startup
  • Specific proxy headers may need to be sent which differ from the upstream request; for instance, Proxy-Authentication should be sent only to the proxy and Authorization should only be sent to the upstream server.

Implements #69 Note: this PR introduces a merge conflict with #71. Whichever lands first will require a manual merge before the other can land.

mbargiel avatar May 22 '22 17:05 mbargiel