当使用GIT clone下载外网项目时,报了该错误。
前情:
为了下载外网项目,提前为终端配置了代理:
export http_proxy=http://127.0.0.1:1087
export https_proxy=socks://127.0.0.1:1080
此处的IP和端口需要根据具体你代理的实际信息填写,可查看VPN客户端的config.json:
"inbounds": [
{
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": false,
"auth": "noauth"
},
"port": "1080"
},
{
"listen": "127.0.0.1",
"protocol": "http",
"settings": {
"timeout": 360
},
"port": "1087"
}
],
检查CURL连接情况:
curl -I www.google.com
收到200响应,说明配置成功。之后开始GIT CLONE操作,报了错误:
“Proxy CONNECT aborted”
原来是没有为GIT单独配置代理,为其配置代理:
git config --global http.proxy 'http://127.0.0.1:1087'
git config --global https.proxy 'socks://127.0.0.1:1080'
即可!