Skip to content

Conversation

@jeremie-stripe
Copy link

In the same way that the environment variable http_proxy and https_proxy are supported, also add support for the final piece of the puzzle which is no_proxy (with the same approach of allowing both a configuration option and the environment to be read).

Since there is no one true way to process the content of the no_proxy value, I tried to follow the most compatible approach as outlined in https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/. See also the man pages of tools like curl or wget for examples.

The PR supports the following options:

  • simple wildcard allow with *
  • equality matching of both hostnames and IP addresses (v4 + v6)
  • suffix matching for hostnames
  • IP (v4 & v6) range matching (using node's builtin BlockList class)

Tests were added.

@chrmarti
Copy link
Collaborator

chrmarti commented Mar 6, 2024

Thanks for the PR! This makes a lot of sense. I wonder if we should replace this with the @vscode/proxy-agent. That will also need to support the setting and it has a different implementation of the parsing: https://github.com/microsoft/vscode-proxy-agent/blob/91b81109c75632b18fa2340f296ccaff9e9bcefa/src/index.ts#L80

@jeremie-stripe
Copy link
Author

jeremie-stripe commented Mar 6, 2024

@chrmarti up to you, it looks like this is used only for extensions today? Any historical reason why it would not have been used for the main request service as well?

Looking at the other implementation it seems roughly similar. The main distinctions I can see are that vscode/proxy-agent supports ports and this one does (EDIT: actually it does, I added tests to make sure) not but this one supports CIDR notation+range which the other one does not. I think it can be combined.

What is your recommendation then?

@jeremie-stripe
Copy link
Author

@chrmarti ping on this PR, my last question still stands on how you want to proceed with this.

@chrmarti
Copy link
Collaborator

Using @vscode/proxy-agent would make sense. Maybe the parsing there can be improved with yours?

@chrmarti
Copy link
Collaborator

Also note that a noProxy setting was added: #211958

@jeremie-stripe
Copy link
Author

jeremie-stripe commented Jan 10, 2025

Moved the bulk of the logic in microsoft/vscode-proxy-agent#60 as discussed (cc @chrmarti)

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Feb 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants