在~/.zshrc或者~/.bashrc中添加如下两行

    1. alias poff="unset http_proxy; unset https_proxy"
    2. alias pon="export http_proxy=http://127.0.0.1:1087;export https_proxy=http://127.0.0.1:1087"

    pon是开启代理,poff是关闭代理

    打开一个命令行窗口:

    1. 开启代理前测一下

    image.png

    1. 开启代理后测测

    image.png