
本文介绍了在Windows系统中配置终端代理的方法,详细说明了如何在cmd、git bash和PowerShell中设置和取消HTTP及socks5代理。具体步骤包括设置代理地址、取消代理的命令,以及在PowerShell中测试代理连接的方法。通过这些设置,可以方便地在Windows终端中使用代理,提升网络连接的灵活性和速度。
Windows cmd 设置代理
设置 HTTP 代理:
set http_proxy=http://127.0.0.1:7890 & set https_proxy=http://127.0.0.1:7890
socks5代理设置:
set http_proxy=socks5://127.0.0.1:7890
set https_proxy=socks5://127.0.0.1:7890
取消代理:
set http_proxy=
set https_proxy=
Windows git bash 设置代理
设置 HTTP 代理:
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890
设置 socks5代理:
git config --global http.proxy socks5://127.0.0.1:7890
git config --global https.proxy socks5://127.0.0.1:7890
取消代理:
git config --global --unset http.proxy
git config --global --unset https.proxy
Windows PowerShell 设置代理
设置 HTTP 代理:
$Env:http_proxy="http://127.0.0.1:7890";$Env:https_proxy="http://127.0.0.1:7890"
代理测试:
curl https://www.google.com