hpagent
hpagent copied to clipboard
Add support for proxyRequestOptions
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
camay need to be passed to the proxy connection but not the upstream connection (or vice versa) and thecavalue is not known at launch or can change over time, preventing the use ofNODE_EXTRA_CA_CERTSas 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-Authenticationshould be sent only to the proxy andAuthorizationshould 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.