Skip to content

proxy-agent: Use proxy-from-env and add docs #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 18, 2020
Merged

proxy-agent: Use proxy-from-env and add docs #2487

merged 5 commits into from
Dec 18, 2020

Conversation

nhooyr
Copy link
Contributor

@nhooyr nhooyr commented Dec 18, 2020

Now we support pretty much every variable under the sun along with
$NO_PROXY all 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.

@nhooyr nhooyr marked this pull request as ready for review December 18, 2020 16:14
@nhooyr nhooyr requested a review from code-asher December 18, 2020 16:14
@nhooyr nhooyr changed the title proxy-agent: Use proxy-env and add docs proxy-agent: Use proxy-from-env and add docs Dec 18, 2020

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

@code-asher code-asher Dec 18, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging/debugging

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

@nhooyr nhooyr merged commit cb44666 into master Dec 18, 2020
@nhooyr nhooyr deleted the proxy-docs-86d4 branch December 18, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants