Linux / 技术 · 2023年5月20日 0

linux命令行设置代理

$ vim ~/.bashrc
# proxy
proxy () {
export http_proxy="http://127.0.0.1:10809"
export https_proxy=$http_proxy
export socks5_proxy="socks5://127.0.0.1:10808"
echo "HTTP Proxy on"
}

# noproxy
noproxy () {
unset http_proxy
unset https_proxy
echo "HTTP Proxy off"
}

$ source ~/.bashrc