Proxy
约 210 字小于 1 分钟
2025-10-21
终端代理
*nix
# 代理
export http_proxy=http://127.0.0.1:7890
export https_proxy=$http_proxy
export ALL_PROXY=socks5://localhost:7890
# 取消
unset http_proxy
unset https_proxy
unset no_proxy
unset ALL_PROXYWin-cmd
# 代理
set http_proxy=http://127.0.0.1:1802
set https_proxy=http://127.0.0.1:1802
# 取消
set http_proxy=
set https_proxy=Win-Posh
# http(s)
$env:http_proxy = "http://<ip>:<port>"
$env:https_proxy = "http://<ip>:<port>"
# socks5
$env:all_proxy="socks5://127.0.0.1:1081"
# 取消
Remove-Item Env:HTTP_PROXY -ErrorAction Ignore
Remove-Item Env:HTTPS_PROXY -ErrorAction Ignore
Remove-Item Env:NO_PROXY -ErrorAction IgnoreGit HTTP(S) 代理
代理
git config --global https.proxy https://127.0.0.1:19810
git config --global http.proxy http://127.0.0.1:19810
# 取消
git config --global --unset http.proxy
git config --global --unset https.proxyGit SSH 代理
nc 的方式不支持认证, ncat 支持
nc
Host github.com
HostName github.com
User git
ProxyCommand nc -X 5 -x 127.0.0.1:7890 %h %pncat
Host github.com
HostName github.com
User git
ProxyCommand ncat --proxy 127.0.0.1:7890 --proxy-type socks5 --proxy-auth user:pass %h %p