Armbian设置网络代理

临时设置 方案

1
2
3
4
export http\_proxy=http://127.0.0.1:8087 
export https\_proxy=\$http\_proxy
export socks5\_proxy="socks5://127.0.0.1:60879"

取消代理

unset http_proxy

永久设置方案

$ vim ~/.zshrc

proxy

1
2
3
4
5
6
proxy () {
export http_proxy="http://127.0.0.1:60879"
export https_proxy=$http_proxy
export socks5_proxy="socks5://127.0.0.1:60879"
echo "HTTP Proxy on"
}

noproxy

1
2
3
4
5
noproxy{
unset http_proxy
unset https_proxy
echo "HTTP Proxy off"
}

$ source ~/.zshrc

使用方式介绍:
通过在当前的终端窗口输入**proxy 、noproxy **命令,就是打开 或 关闭代理。
注意:需要在每个终端窗口都打开一次。

1
2
3
4
➜  \~ proxy HTTP 
Proxy on
➜ \~ noproxy HTTP
Proxy off

测试
curl ip.sb
如果用bash,可以直接上面命令的 ~/.zshrc 换成 ~/.bashrc


以上内容引用自:博客园-Mysticbinary