问题
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:
- start vscode with below command
code --proxy-server="xxx.xx.xx.xx:port"
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
- Locate the Proxy script path from
Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
- From the proxy pac file locate the proxy server domain name/port details (chose one that allows internet connection if there are many)
- In VS Code go to File > Preferences > Settings and search for "Proxy"
- Enter the proxy server url in the Http: Proxy (http.proxy) setting field
- Un-tick check box for Http: Proxy Strict SSL ( http.proxyStrictSSL)
- Restart VS code
来源:https://stackoverflow.com/questions/40404000/problems-with-proxy-in-vscode