Open garbiras opened 6 years ago
I like the idea of smarter proxy handling. Would it make sense to completely replace 'corporateProxyAgent' with the retval from getProxyForUrl()?
Yes, this looks good. I'll test this out, and try to get it merged in soon. Thanks for the contribution!
I tested this out and hit a problem. I'm running locally behind a corporate firewall, with real services. My browser makes a request to localhost, which then proxies the request to the back end service. When I put in your change, I get an error. Since my no_proxy env var includes localhost, no proxy agent is added to the request. But I actually do need the proxy agent in this case.
proxy-from-env npm module determines if a URL should be proxied by using the standard proxy environment variables (http_proxy, no_proxy etc.). NO_PROXY tokens are supported, including wildcard expressions (i.e. .ge.com)