-
Notifications
You must be signed in to change notification settings - Fork 91
使用privoxy和shadowsocks搭建局域网http代理
LinHui Lou edited this page Mar 17, 2017
·
2 revisions
开发环境迁移到局域网,由于github被墙,无法自动安装legolas-vim。
-
安装shadowsocks并配置(~/.ShadowsocksX/gfwlist.js)
// var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;"; var proxy = "PROXY 0.0.0.0:1080; SOCKS 0.0.0.0:1080; DIRECT;";
-
安装privoxy并配置(/usr/local/etc/privoxy/config):
listen-address 0.0.0.0:8118 forward-socks5 / localhost:1080 .
-
启动privoxy:
/usr/local/Cellar/privoxy/3.0.26/sbin/privoxy /usr/local/etc/privoxy/config // 确认是否成功启动 lsof -i:8118 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME privoxy 91575 xxxxxxx 4u IPv4 0x909f5e901e5c5fff 0t0 TCP *:privoxy (LISTEN)
-
设置github全局代理
git config --global https.proxy https://xxx.xxx.xxx.xxx:8118 git config --global http.proxy http://xxx.xxx.xxx.xxx:8118 git config --global core.gitProxy socks5://localhost:1080
-
取消github代理设置
git config --global --unset http.proxy git config --global --unset https.proxy