Skip to content
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

Proxy Support for Extensions should also include NO_PROXY #68260

Closed
nschonni opened this issue Feb 8, 2019 · 11 comments
Closed

Proxy Support for Extensions should also include NO_PROXY #68260

nschonni opened this issue Feb 8, 2019 · 11 comments
Assignees
Labels
feature-request Request for new features or functionality proxy Issues regarding network proxies verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@nschonni
Copy link
Contributor

nschonni commented Feb 8, 2019

Issue Type: Feature Request

The support for Extensions using the proxy setting is great! Unfortunatly for some things like "ms-vsts.team" extension or others where you need to connect to internal resources the proxy settings need to be ignored. This can be done through the NO_PROXY variable, or maybe even just a custom list in the settings to reproduce the NO_PROXY list so that internal extensions don't fail when requesting resources inside a firewall

VS Code version: Code 1.31.0 (7c66f58, 2019-02-05T22:35:56.624Z)
OS version: Windows_NT x64 6.1.7601

@chrmarti
Copy link
Contributor

Related: #12588

@chrmarti chrmarti added proxy Issues regarding network proxies feature-request Request for new features or functionality labels Feb 11, 2019
@miguellira
Copy link

@nschonni I am running into an issue with ms-vsts.team when attempting to sign in to a local TFS server and I believe it surfaced after updating VS Code. Unfortunately, I am not able to find any logs that clearly state the error. The only indication is a (!) next to Team in the status bar and when I hover over I see the message Failed Request: Temporary Redirect(307) -:

image

Are you experiencing a similar issue. If so, what is your current workaround? Downgrade to a previous version of VS Code?

@miguellira
Copy link

@nschonni Please disregard. After I posted this message I found the following issue that resolved my error.

Visual Studio Code now provides a Proxy Support setting that can be disabled.

@chrmarti
Copy link
Contributor

Related: microsoft/azure-repos-vscode#465

@chrmarti chrmarti added this to the March 2019 milestone Feb 27, 2019
@chrmarti
Copy link
Contributor

chrmarti commented Mar 5, 2019

There does not appear to be any agreement between different tools on how to interpret NO_PROXY.

Would the following work:

  • NO_PROXY is a comma-separated list of hostnames and domains.
  • A hostname (e.g., mail, company.com, www.company.com) matches only that one hostname.
  • A domain starts with a . (e.g., .company.com) and matches all hostnames in that domain, including the hostname equal to the domain (e.g., .company.com matches company.com, www.company.com, mail.company.com).

/cc @joaomoreno

@nschonni
Copy link
Contributor Author

nschonni commented Mar 5, 2019

I'd suggest looking at/using the request implementation https://github.com/request/request#controlling-proxy-behaviour-using-environment-variables
It is the most used network library for node, and is well tested for edge cases.

@chrmarti
Copy link
Contributor

chrmarti commented Mar 5, 2019

Good point, I'll go with that. They additionally:

  • Let hostnames match all hosts in subdomains (e.g., company.com matches www.company.com).
  • Let * match all hostnames.
  • Let hostname:port match only if the port matches too.

chrmarti added a commit that referenced this issue Mar 5, 2019
@joaomoreno
Copy link
Member

joaomoreno commented Mar 6, 2019

@chrmarti Also relevant:

# Disable proxy per host
--proxy-bypass-list=(<trailing_domain>|<ip-address>)[:<port>][;...]

https://code.visualstudio.com/docs/setup/network#_proxy-server-support

@chrmarti
Copy link
Contributor

chrmarti commented Mar 6, 2019

@joaomoreno I think we should get these through Electron's API already.

@chrmarti
Copy link
Contributor

chrmarti commented Mar 8, 2019

@nschonni This is in the latest Insiders build. Could you give it a try and let me know if it works for you?

@chrmarti
Copy link
Contributor

chrmarti commented Apr 1, 2019

To verify:

  • Prepare a test extension with two requests and verify they work:
    • http.get('http://microsoft.com', res => console.log(res.statusCode)).on('error', console.error);
    • http.get('http://github.com', res => console.log(res.statusCode)).on('error', console.error);
  • Start VS Code with environment variable HTTP_PROXY=http://localhost:9999 (without anything listening on that port) and verify both requests fail.
  • Start VS Code with environment variables HTTP_PROXY=http://localhost:9999 (without anything listening on that port), NO_PROXY=microsoft.com and verify only the github.com request fails.

@chrmarti chrmarti removed the verification-steps-needed Steps to verify are needed for verification label Apr 1, 2019
@alexr00 alexr00 added the verified Verification succeeded label May 7, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality proxy Issues regarding network proxies verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants