代理工具准备
- Clash 等
以端口使用7890为例
安装浏览器代理插件
配置终端代理
MacOS
iterm终端
bash
alias http_proxy="http_proxy=http://127.0.0.1:7890"
alias https_proxy="https_proxy=http://127.0.0.1:7890"
alias all_proxy="all_proxy=socks5://127.0.0.1:7890"
alias proxy_off="export https_proxy=;export http_proxy=;export all_proxy=;curl ipinfo.io;echo -e '\n终端代理已关闭'"
alias proxy_on="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;curl ipinfo.io;echo -e '\n终端代理已开启'"
alias proxy_check="curl -I --connect-timeout 10 -w %{http_code} https://facebook.com"
alias proxy_status="curl -I --connect-timeout 10 -w %{http_code} https://facebook.com"
alias ip="curl cip.cc"
Git
配置拉取github仓库代码走代理
vi ~/.ssh/config
bash
Host github.com
Hostname ssh.github.com
Port 443
ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
其他
排除 T3 打车 APP 的提示
Surge 及 Shadowrocket 在使用「 T3 出行」时遇到「检测到您正在使用网络代理,请关闭网络…」的,可以在文本编辑模式编辑,在 [General] 下的 skip-proxy 增加:passenger.t3go.cn 注意,passenger.t3go.cn 和原先内容之间要有英文逗号