Repository navigation
proxy-agent: Use proxy-from-env and add docs - #2487
Conversation
Now we support pretty much every variable under the sun along with $NO_PROXY all correctly and with minimal code on our end.
64bed0e to
cb72128
Compare
| const https = require("https") | ||
|
|
||
| logger.debug(`using $HTTP_PROXY ${process.env.HTTP_PROXY}`) | ||
| // If we do not pass in a proxy URL, proxy-agent will get the URL from the environment. |
There was a problem hiding this comment.
Should we always set it? It looks like it does the same check except the downside is that it runs for every request. The upside is we don't have to check ourselves with http://example.com.
There was a problem hiding this comment.
I didn't put this on a good line, should've put it on the if. I was thinking about how it reads from the environment so I put it here on the comment. 😛
There was a problem hiding this comment.
Should we always set it? It looks like it does the same check except the downside is that it runs for every request.
I added the check for logging purposes. This is the log that uncovered the extension host logging bug for example.
Now we support pretty much every variable under the sun along with
$NO_PROXYall correctly and with minimal code on our end.Also added an FAQ entry on them.
@code-asher I'd recommend looking at the PR diff instead of by commit as the early
commits are from my confusion but I'd like to include them for posterity.