17

I'm testing VSCode by first time and I configure my proxy in settings.json as recommended:

"http.proxy": "http://domain\user:pass@myproxy:port/"

But it doesn't work when I try to install new extensions I get a connected timeout error. I also try to configure the proxy as system environment variable with the same result. Could you help me? Is it a bug or I'm doing something wrong? Is there another way to download extensions?

Thank you very much!

2
  • Same problem here. It used to work but now in version 1.8.1 the log shows Failed to load resource: net::ERR_TUNNEL_CONNECTION_FAILED Commented Jan 3, 2017 at 9:35
  • They added a new setting to the configuration named "http.proxyAuthorization" but this does not work. I found that someone already reported it: github.com/Microsoft/vscode/issues/17502 Commented Jan 3, 2017 at 12:46

10 Answers 10

16
  1. start vscode with below command

    code --proxy-server="xxx.xx.xx.xx:port"

  2. add command in desktop for vscode

    /usr/share/applications/code.desktop

    Exec=/usr/share/code/code --proxy-server="xx.x.x.xx:xxx" --unity-launch %F

Sign up to request clarification or add additional context in comments.

2 Comments

Took me so long to get to this. TNX
on Mac VSCode located in /Applications/Visual Studio Code.app/Contents/Resources/app/bin , so run as "./code <rest of command>"
10

Setting Up VS code behind proxy (Proxy script pac file) in Windows 10 to install extensions and updates

  1. Locate the Proxy script path from Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
  2. From the proxy pac file locate the proxy server domain name/port details (chose one that allows internet connection if there are many)
  3. In VS Code go to File > Preferences > Settings and search for "Proxy"
  4. Enter the proxy server url in the Http: Proxy (http.proxy) setting field
  5. Un-tick check box for Http: Proxy Strict SSL ( http.proxyStrictSSL)
  6. Restart VS code

1 Comment

First, you forgot to start with: Open a terminal window and start the Registry Editor by typing "regedit" Second, the "Software" (on my machine) is all caps: "SOFTWARE". Third, there is no "proxy pac" under Name or Type. There is a mention of in the "Data" column, at the end of a url containing the server domain name (e.g.127.0.0.1) and port (e.g. 64730). Finally, how can I get VS Code loaded in the first place to change its Proxy if I can't run it in WSL Ubuntu in the first place? (answer: Turn off the VPN temporarily). Finally, call code from Ubuntu, not Windows.
6

In VS code: File -> Preferences ->Settings.

 {
    "http.proxyStrictSSL":false,
    "http.proxy":"http://USERID:[email protected]:3128"
 }

It works for me. And will work for you too. It appears that in http.proxy you have added "domain" after "http://" which is not required.

1 Comment

Adding password to the settings is not safe. Its not masked.
3

I was having issues too. Try adding:

"http.proxyStrictSSL": false

to your settings.json file.

1 Comment

Did this resolve the issue ? For me it does not seem to work unfortunatly.
2

Here is a solution in Windows 7.

Change the system proxy to your proxy, like localhost:3128, in Internet Options => Connections => LAN Settings.

After a version (1.35.0 maybe), the proxy settings in the Settings of vscode seems not working. My proxy is down as soon as I update. Finally, I fixed the problem by changing the system proxy.

An official reference: https://code.visualstudio.com/docs/setup/network

1 Comment

Thanks, your solution gave me an idea to make it a more generic solution. What I did was, I went to Internet Options => Connections => LAN Settings, and then I checked the "Automatically detect setting" and un-checked all other boxes. and it worked like a charm!!!!!
2

As @Yan QiDonge mentioned you can do that.

But if you want to have a more generic solution, this is what I did. What I did was, I went to Internet Options => Connections => LAN Settings, and then I checked the "Automatically detect setting" and un-checked all other boxes. and it worked like a charm!!!!!

Comments

2

Just by Googling I came across this psudie disclaimer about extensions not being able to benefit from proxy support in VSCode:

Legacy proxy server support Extensions don't benefit yet from the same proxy support that VS Code supports. You can follow this issue's development in GitHub.

Similarly to extensions, a few other VS Code features don't yet fully support proxy networking, namely the CLI interface. The CLI interface is what you get when running code --install-extension vscodevim.vim from a command prompt or terminal. You can follow this issue's development in GitHub.

Due to both of these constraints, the http.proxy, http.proxyStrictSSL and http.proxyAuthorization variables are still part of VS Code's settings, yet they are only respected in these two scenarios.

However using ctrl+comma enter image description here

It seems to be easiest way with maximum result! Even cadmium works although there is a github issue : CLI proxy support #29910

Comments

1

None was working for me. For NTLM proxy, I've found this project https://github.com/genotrance/px.

  1. It requires to install python first
  2. Install PX : python -m pip install px-proxy
  3. Enter and save creds : px --username=DOMAIN\yourusername --password
  4. Start the proxy server : px --proxy=proxy.int:8080 --listen=127.0.0.1 --port=3128 --username=DOMAIN\yourusername
  5. Configure your machine to use the local proxy address Local proxy address
  6. No action is required in vs code.

Alternative

  1. Configure only Vs Code, not the machine : use these settings in vs code (File, Preferences, Settings or settings.json)
    {
        "http.proxy": "http://127.0.0.1:3128",
        "http.proxyStrictSSL": false
    }
    

1 Comment

This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review
0

If you are using yarn run this command it worked for me

"yarn config set strict-ssl false"

This worked for me

Comments

0

Check system proxy settings,configure manual proxy and then set it to environment variables as well. Restart the system and VS code It should work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.