终端开启代理和关闭代理的方法

    技术2022-07-10  143

    设置alias快捷

    alias proxy="export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 && curl ip.sb" alias proxyx="unset http_proxy https_proxy all_proxy && curl ip.sb"

    windows直接cmd使用

    set export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=socks5://127.0.0.1:7891 && curl ip.sb

    使用时直接在命令行输入proxy/proxyx,成功后可以看到当前ip。

    mac alias目录

    ~/.bashrc

    linux alias目录

    /etc/bashrc
    Processed: 0.011, SQL: 9