终端配置代理

终端配置代理函数

function proxy_on() {
    export http_proxy=http://127.0.0.1:xxxx
    export https_proxy=http://127.0.0.1:xxxx
    echo "已开启代理"
}
function proxy_off() {
    unset http_proxy
    unset https_proxy
    echo "已关闭代理"
}

使用方法

在终端直接运行
proxy_on 即可打开终端 http 代理
proxy_off 关闭代理

查看Ip来源

curl http://ip.gs/json
curl http://www.cip.cc/

原文地址:https://www.cnblogs.com/hanpengyu/p/14836251.html