pemola
pemola

Reputation: 201

problems with proxy in vscode

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!

Upvotes: 13

Views: 124398

Answers (10)

ARPITA BANERJEE
ARPITA BANERJEE

Reputation: 1

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

Upvotes: 0

julien padovani
julien padovani

Reputation: 11

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
    }
    

Upvotes: 0

Max
Max

Reputation: 4408

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

Upvotes: 1

Reza Shek
Reza Shek

Reputation: 681

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!!!!!

Upvotes: 2

Sushrut Singh Sisodiya
Sushrut Singh Sisodiya

Reputation: 1000

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

"yarn config set strict-ssl false"

This worked for me

Upvotes: 0

Atul Chinchalkar
Atul Chinchalkar

Reputation: 188

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

Upvotes: 10

Yan QiDong
Yan QiDong

Reputation: 4441

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

Upvotes: 2

li.qzeng
li.qzeng

Reputation: 177

  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

Upvotes: 14

Rajat Surana
Rajat Surana

Reputation: 323

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.

Upvotes: 5

Chris Moore
Chris Moore

Reputation: 525

I was having issues too. Try adding:

"http.proxyStrictSSL": false

to your settings.json file.

Upvotes: 3

Related Questions