problems with proxy in vscode

纵然是瞬间 提交于 2020-12-31 05:48:20

问题


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!


回答1:


  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




回答2:


I was having issues too. Try adding:

"http.proxyStrictSSL": false

to your settings.json file.




回答3:


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

 {
    "http.proxyStrictSSL":false,
    "http.proxy":"http://USERID:PASSWORD@proxy.domain.com: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.




回答4:


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




回答5:


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


来源:https://stackoverflow.com/questions/40404000/problems-with-proxy-in-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!