1.给 Windows 的终端配置代理
set http_proxy=http://127.0.0.1:1080
set https_proxy=http://127.0.0.1:1080
set http_proxy_user=user
set http_proxy_pass=pass
set https_proxy_user=user
set https_proxy_pass=pass
# 恢复
set http_proxy=
set https_proxy=
# Ubuntu 下命令为 export
# export http_proxy=http://127.0.0.1:1080
要点
- 一定要加
http://
,直接写域名或者 IP 不行。 - http 和 https 都要设置。
然后如果想验证是否成功配置了代理的话,用 ping
命令是不可以的
ping 还是不行的原因
ping的协议不是https,也不是https,是ICMP协议。
验证方式
curl -vv http://www.google.com
,用这条命令来验证,如果返回如下结果表示代理设置成功。
这里还有一个坑是,