在~/.zshrc 或 ~/.bashrc添加以下
~/.zshrc
~/.bashrc
export localIP=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }') alias proxy='export ALL_PROXY="http://$localIP:1080"' alias unproxy='unset ALL_PROXY'
手机扫一扫转发分享