Closed mbargiel closed 2 years ago
Hi @delvedor ! I see you reviewed #81 which is practically the same as this PR (with subtle differences, and this one has tests) but not this one. Is there anything missing to this one?
@delvedor Will do! Expect an update within a day or two.
@delvedor See https://github.com/delvedor/hpagent/pull/72/commits/a112371f1fe74858f049eb3e27765f7c591b2ea0. Please note that I defined a single type for the proxyRequestOptions
of both agent types because the proxy options and upstream protocol are orthogonal: for instance, you may need to pass custom TLS connect options to a proxy agent of either types HttpProxyAgent or HttpsProxyAgent, since either can be used over an HTTPS proxy connection.
EDIT: Sorry for the force-pushes, I realized the new interface was misnamed. I think I found a relevant name in the end, but I'm open to renaming it if needed.
Released in v1.1.0
, thanks for contributing!
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:ca
may need to be passed to the proxy connection but not the upstream connection (or vice versa) and theca
value is not known at launch or can change over time, preventing the use ofNODE_EXTRA_CA_CERTS
as a viable alternative because that environment variable is only used by Node during startupProxy-Authentication
should be sent only to the proxy andAuthorization
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.