problems with proxy in vscode
Asked Answered
M

9

12

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!

Mcduffie answered 3/11, 2016 at 14:23 Comment(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_FAILEDRain
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/17502Rain
M
12
  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

Mattoid answered 21/12, 2018 at 9:12 Comment(2)
Took me so long to get to this. TNXBlueberry
on Mac VSCode located in /Applications/Visual Studio Code.app/Contents/Resources/app/bin , so run as "./code <rest of command>"Repine
A
9

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
Attainable answered 3/9, 2020 at 2:51 Comment(1)
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.Guadalajara
W
5

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.

Whistler answered 3/12, 2017 at 8:50 Comment(0)
B
3

I was having issues too. Try adding:

"http.proxyStrictSSL": false

to your settings.json file.

Bald answered 17/1, 2017 at 22:22 Comment(1)
Did this resolve the issue ? For me it does not seem to work unfortunatly.Summarize
I
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

Inearth answered 10/6, 2019 at 9:19 Comment(1)
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!!!!!Mehalek
M
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!!!!!

Mehalek answered 16/6, 2022 at 18:16 Comment(0)
S
1

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

Shaylynn answered 5/8, 2023 at 14:8 Comment(0)
P
0

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

"yarn config set strict-ssl false"

This worked for me

Pentathlon answered 7/9, 2021 at 10:55 Comment(0)
N
0

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
    }
    
Nyberg answered 4/4 at 9:6 Comment(1)
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 ReviewDorinda

© 2022 - 2024 — McMap. All rights reserved.