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

Investigate setting Electron's proxy from user setting #94148

Open
ForceConstant opened this issue Apr 1, 2020 · 13 comments
Open

Investigate setting Electron's proxy from user setting #94148

ForceConstant opened this issue Apr 1, 2020 · 13 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug proxy Issues regarding network proxies
Milestone

Comments

@ForceConstant
Copy link

  • VSCode Version: 1.43.2
  • OS Version: Ubuntu 18.04

Steps to Reproduce:

  1. Set proxy from OS, and in settings.json, but still can't browse or install extensions. Looking at log I get ERR_CONNECTION_TIMED_OUT
@vscodebot
Copy link

vscodebot bot commented Apr 1, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@chrmarti
Copy link
Contributor

chrmarti commented Apr 1, 2020

Where do you set it in the OS?

Does code --proxy-server=... work? (https://code.visualstudio.com/docs/setup/network#_proxy-server-support)

@chrmarti chrmarti added info-needed Issue requires more information from poster proxy Issues regarding network proxies labels Apr 1, 2020
@ForceConstant
Copy link
Author

I have the HTTP_PROXY, and HTTPS_PROXY set in environment variables. And I have set it in the network settings in ubuntu. I also tried to code --proxy-server="http://my.proxy.ip:80" still no go.

@chrmarti
Copy link
Contributor

chrmarti commented Apr 2, 2020

@ForceConstant What's in the dev console (Help > Toggle Developer Tools) when you use --proxy-server=...?

/cc @deepak1556

@ForceConstant
Copy link
Author

So it turns out that I had the syntax a little wrong on the --proxy-server option. I had the http:// in the url. And now it works. Thanks. But why doesn't the extensions part use setting.json info?

@chrmarti
Copy link
Contributor

chrmarti commented Apr 2, 2020

We are not in control of the settings Chromium's network implementation is using. The only way to set that is through the OS settings (although I'm not sure which ones on Linux, @deepak1556 do you know?) or through the command line option.

@deepak1556 is there a way for us to set the proxy server on Chromium when the user sets one in our settings.json?

@deepak1556
Copy link
Contributor

@chrmarti its achievable using the setproxy api from electron https://github.com/electron/electron/blob/master/docs/api/session.md#sessetproxyconfig , it allows for the same set of configuration you would expect from --proxy-server, --proxy-pac-url, --proxy-bypass-list

By default chromium and electron should pick the system proxy configuration if the platform supports it.

@ForceConstant does chromium browser on your system allow setting proxy via chrome://settings/system ?

@chrmarti chrmarti added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Apr 3, 2020
@chrmarti chrmarti changed the title Unable to get proxy to work for extensions, ubuntu Investigate setting Electron's proxy from user setting Apr 3, 2020
@chrmarti chrmarti added this to the April 2020 milestone Apr 3, 2020
@chrmarti
Copy link
Contributor

chrmarti commented Apr 8, 2020

Setting the proxy on the session now if the http.proxy setting is not empty. Previously the setting only affected extensions. This should make it easier to use.

chrmarti added a commit that referenced this issue Apr 22, 2020
chrmarti added a commit that referenced this issue Apr 22, 2020
@rebornix
Copy link
Member

@chrmarti can you provide details about what to test and how?

@rebornix rebornix added the verification-steps-needed Steps to verify are needed for verification label Apr 30, 2020
@chrmarti
Copy link
Contributor

chrmarti commented May 1, 2020

The best I currently have is:

  • Start a local proxy and follow its access log:
PROXY_CONTAINER=`docker run -d -p 3128:3128 minimum2scp/squid`
docker exec $PROXY_CONTAINER tail -F /var/log/squid/access.log
  • Set setting http.proxy to http://localhost:3128.
  • Test extension search and install and check for VS Code updates and verify that these requests show up in the proxy's log.

Testing this now I don't see the update check, the download of VS Code and extensions. Reopening for investigation.

@chrmarti chrmarti reopened this May 1, 2020
@chrmarti chrmarti modified the milestones: April 2020, May 2020 May 1, 2020
@chrmarti chrmarti removed the verification-steps-needed Steps to verify are needed for verification label May 1, 2020
@deepak1556
Copy link
Contributor

@chrmarti for something unrelated, I was using https://github.com/joaomoreno/proxy-containers/tree/master/basic-auth and was able to verify that proxy settings are respected through settings.json and env variables. Tried exactly the same steps as above only the containers are different.

@chrmarti
Copy link
Contributor

@deepak1556 Thanks, wasn't aware of that. I ended up coming up with my own container for the policy issue in auth.html from last week: https://github.com/microsoft/vscode-proxy-agent/tree/master/tests/test-http-auth-proxy.

@chrmarti chrmarti modified the milestones: May 2020, June 2020 Jun 4, 2020
@chrmarti chrmarti removed this from the June 2020 milestone Jul 2, 2020
@chrmarti chrmarti added this to the July 2020 milestone Jul 2, 2020
@chrmarti chrmarti modified the milestones: July 2020, August 2020 Aug 6, 2020
@chrmarti chrmarti modified the milestones: August 2020, September 2020 Sep 3, 2020
@chrmarti chrmarti modified the milestones: September 2020, October 2020 Oct 1, 2020
@chrmarti chrmarti modified the milestones: October 2020, November 2020 Oct 30, 2020
@chrmarti chrmarti modified the milestones: November 2020, Backlog Nov 17, 2020
@JarrettSpiker
Copy link

How can I request that this:

Setting the proxy on the session now if the http.proxy setting is not empty. Previously the setting only affected extensions. This should make it easier to use.

Be added to the documentation (unless I am missing it)? This page https://code.visualstudio.com/docs/setup/network#_legacy-proxy-server-support seems to state explicitly that http.proxy will not be respected by VSCode, and is there only for extensions and the CLI.

It is very helpful that VSCode also respects the http.proxy configuration, I just want to make sure I am using things as-intended, and not relying on functionality which may break in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug proxy Issues regarding network proxies
Projects
None yet
Development

No branches or pull requests

5 participants