重阳过后,西风渐紧,庭树叶纷纷。——晏殊《少年游·重阳过后》
- 安装代理软件 https://github.com/yichengchen/clashX
两种方法
方法一(好处:可控,需要进行brew更新才使用;坏处:较为繁琐)
在
.bashrc
或.zshrc
设置# 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:7890; echo 'Proxy on'" alias unproxy="unset https_proxy http_proxy all_proxy; echo 'Proxy off'"
生效
source .zshrc
每次iTerm2设置登录执行
proxy
或手动执行proxy
方法二(好处:便捷;坏处:可能影响其他命令)
在
.bashrc
或.zshrc
设置# Proxy export https_proxy=http://127.0.0.1:7890 export http_proxy=http://127.0.0.1:7890 export all_proxy=socks5://127.0.0.1:7890
生效
source .zshrc
执行命令
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- 按照指令安装
执行命令查看是否正常
brew -v # output: # Homebrew 3.2.17-133-g890190c # Homebrew/homebrew-core (git revision 5d84b1431d6; last commit 2021-10-23) # Homebrew/homebrew-cask (git revision 65500e81bf; last commit 2021-10-23)