100 way to setting proxy

$ terminal setting proxy:

export http_proxy=socks5://127.0.0.1:5566
export https_proxy=$http_proxy
unset http_proxy https_proxy

$ see other proxy setting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ add some alias
alias goproxy='export http_proxy=socks5://127.0.0.1:5566 https_proxy=socks5://127.0.0.1:5566'
alias disproxy='unset http_proxy https_proxy'
$ setting homebrew :
export ALL_PROXY=socks5://127.0.0.1:5566
ALL_PROXY=socks5://127.0.0.1:9001 brew upgrade
$ see what ip you in!
curl ip.cn
add sss
/usr/local/opt/shadowsocks-libev/bin/ss-local -c /usr/local/etc/shadowsocks-libev.json > /dev/null 2>&1 &
/usr/local/opt/shadowsocks-libev/bin/ss-local -c /usr/local/etc/shadowsocks-libev-cn.json > /dev/null 2>&1 &
/usr/local/opt/shadowsocks-libev/bin/ss-local -c /usr/local/etc/shadowsocks-libev-jp.json > /dev/null 2>&1 &

也可以使用Mac的launchctl来启动|停止

1
2
3
4
5
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.xxxxx.plist
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.xxxx.plist # 新增定时任务
ln -sfv /usr/local/opt/xxx/*.plist ~/Library/LaunchAgents # 设置开机启动
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.xxxx.plist