node-http-proxy
node-http-proxy copied to clipboard
Allow any custom agent instead of just follow-redirects
Codecov Report
:exclamation: No coverage uploaded for pull request base (
master@a3fe02d). Click here to learn what that means. The diff coverage is100%.
@@ Coverage Diff @@
## master #1285 +/- ##
=========================================
Coverage ? 92.33%
=========================================
Files ? 6
Lines ? 313
Branches ? 0
=========================================
Hits ? 289
Misses ? 24
Partials ? 0
| Impacted Files | Coverage Δ | |
|---|---|---|
| lib/http-proxy/passes/web-incoming.js | 98.3% <100%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update a3fe02d...52ac7cd. Read the comment docs.
There's already an agent option, but it doesn't look like it's fully implemented. What do you think about using agent instead of httpAgent?
There's already an
agentoption, but it doesn't look like it's fully implemented. What do you think about usingagentinstead ofhttpAgent?
you're right; agent + httpAgent certainly makes things confusing; possibly docs update to clarify better?
code wise it looks like this
http.request(options);
^ ^
| |
httpAgent |
agent
e.g. lib/http-proxy/passes/web-incoming.js:125
my use case was to replace tls with custom module for https requests
Oh, I see - this is where we could use something like e.g. axios or got instead of actually using http module's .request() with something that http.Agent, right? But httpAgent here would still need to implement the http.ClientRequest interface? So...not axios or got? Wouldn't the TLS changes have mostly been specific to the agent anyhow?
There's probably room for refactoring to provide a single configuration that allows both (e.g. hooks for creating connection and getting the stream), but it's probably moot anyhow, since this your PR is going on 4 years old, there have been no commits in almost 2 years. Perhaps a strong ping in the "New Maintainers" issue would receive a response, as indexzero does seem to still be relatively active on GitHub.
thanks, your mentions probably already have alerted maintainers. let's see what's suggested.