×

Mac 下如何大幅度提升 github 的推送速度

96
自由快挂
2016.08.22 13:55* 字数 128

工具

  1. http://www.privoxy.org/
  2. ShadowsocksX

git 的 sock5 代理似乎并不好用,所以的寻求 http 的代理方案。

安装程序

brew install  privoxy

遇到问题:

==> ./configure --prefix=/usr/local/Cellar/privoxy/3.0.23 --sysconfdir=/usr/local/etc/privoxy --localstatedi
==> make
==> make install
==> Caveats
To have launchd start privoxy at login:
    ln -sfv /usr/local/opt/privoxy/*.plist ~/Library/LaunchAgents
Then to load privoxy now:
    launchctl load ~/Library/LaunchAgents/homebrew.mxcl.privoxy.plist
Or, if you don't want/need launchctl, you can just run:
    privoxy /usr/local/etc/privoxy/config
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink sbin/privoxy
/usr/local/sbin is not writable.

You can try again using:
  brew link privoxy
==> Summary
🍺  /usr/local/Cellar/privoxy/3.0.23: 51 files, 1.6M, built in 71 seconds

手动 link 一下 privoxy:

sudo ln -sv /usr/local/Cellar/privoxy/3.0.23/sbin/privoxy /usr/local/bin/

配置文件

打开文件 /usr/local/etc/privoxy/config

注释掉

listen-address  localhost:8118
#listen-address  localhost:8118

在最后一行后边加上

forward-socks5 / 127.0.0.1:1080 .
listen-address 127.0.0.1:8118

启动 privoxy

privoxy /usr/local/etc/privoxy/config

为当前终端设置代理

export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118

2016-10-28 更新
如果你使用 ShadowsocksX-NG,则需要在高级设置里面把 Local Socks5 Listen Port: 修改为 1080

参考:
https://gist.github.com/Alexniver/9a4f1791fe4305b0750a

work log
Web note ad 1