delvedor / hpagent

A ready to use http and https agent for working with proxies that keeps connections alive!
MIT License
182 stars 36 forks source link

global-agent interfering with hpagent as `agent` is set to `false` #55

Open HughePaul opened 2 years ago

HughePaul commented 2 years ago

We are trying to use global-agent for proxying most HTTP connections automatically, but hpagent for overriding proxying certain endpoints via a different proxy (eg internal vs external API connections).

hpagent's outgoing proxy connections are being intercepted and are also going over global-agent's proxy, as agent is set to false.

It would be useful to be able to either specify the agent for outgoing proxy connections, or if it was a new http(s).Agent instead of false by default.

I don't think this is a bug/feature-request for global-agent, as you'd expect that to override requests with agent set to a non-pooling false value.