跳至主要內容

Macos终端代理

MacosMacos小于 1 分钟约 110 字全民制作人ikun

Macos终端代理

~/.bash_profile中:

alias proxy="
    export http_proxy=socks5://127.0.0.1:7890;
    export https_proxy=socks5://127.0.0.1:7890;
    export all_proxy=socks5://127.0.0.1:7890;
    export no_proxy=socks5://127.0.0.1:7890;
    export HTTP_PROXY=socks5://127.0.0.1:7890;
    export HTTPS_PROXY=socks5://127.0.0.1:7890;
    export ALL_PROXY=socks5://127.0.0.1:7890;
    export NO_PROXY=socks5://127.0.0.1:7890;"
alias unproxy="
    unset http_proxy;
    unset https_proxy;
    unset all_proxy;
    unset no_proxy;
    unset HTTP_PROXY;
    unset HTTPS_PROXY;
    unset ALL_PROXY;
    unset NO_PROXY"

之后开启代理:

proxy

关闭代理:

unproxy

检测是否开启:

curl cip.cc
image-20240613165054669
image-20240613165054669
上次编辑于:
贡献者: yunfeidog