Epiphyllum

Linux/Mac终端科学上网/代理

Linux/Mac 下终端的科学上网#

vim ~/.zshrc 不同终端不一样 注意代理端口

proxy(){
    export http_proxy="http://127.0.0.1:7890"
    export HTTP_PROXY="$http_proxy"
    export https_proxy="http://127.0.0.1:7890"
    export HTTPS_PROXY="$https_proxy"
    export socks_proxy="socks5://127.0.0.1:7890"
    export SOCKS_PROXY="$socks_proxy"
		echo "proxy start"
}

unproxy(){
		unset http_proxy
		unset https_proxy
		unset socks_proxy
    unset HTTP_PROXY
    unset HTTPS_PROXY
    unset SOCKS_PROXY
		echo "proxy stop"
}
gitproxy(){
    git config --global http.proxy 'http://127.0.0.1:7890'
    git config --global https.proxy 'http://127.0.0.1:7890'
    echo 'git proxy start'
}

ungitproxy(){
    git config --global --unset http.proxy
    git config --global --unset https.proxy
    echo 'git proxy stop'
}
Linux/Mac终端科学上网/代理
https://epiphyllum.masttf.fun/post/proxy
作者
Masttf
发布于
4/16/2025
许可协议
CC BY-NC-SA 4.0