leafsummer
2/20/2016 - 7:38 AM

使用 https://github.com/clowwindy/gfwlist2pac 生成自定义 PAC 的辅助脚本

使用 https://github.com/clowwindy/gfwlist2pac 生成自定义 PAC 的辅助脚本

Installation

  • Place this script autopac.sh to: $HOME/Dropbox/Apps/dev/pac

  • Place user_rule.txt to the same location

  • Then use crontab -e to add a scheduling work like this:

    10 14 * * * nohup $HOME/Dropbox/Apps/dev/pac/autopac.sh
    

    which will schedule this script to run every day at 2:10pm

  • You must install @clowwindy's gfwlist2pac first, using this command

    pip install gfwlist2pac
    

    or

    sudo easy_install gfwlist2pac
    

You now could configure your GoAgentX to use this custom PAC instead. Now we could stop complaining that @ohdarling88 drops the gfwlist supports in his GoAgentX version2

Enjoy it.

Thanks to @ohdarling88, @clowwindy

More works need to do

  • add user rule supports for multiple proxies (such as u2b should go through GAE instead of shadowsocks)
! clowwindy's buildin rules !
google.com
google.co.jp
google.co.hk
github.com
wikipedia.org

! rules for me !
t.co
fb.me
bit.ly
sourceforge.net
nytimes.com
jetbrains.com
intellij.net
wikipedia.org
wikimedia.org
tumblr.com
fqrouter.com
feedly.com
dropbox.com
mshcdn.com
bootply.com
feedsportal.com
twimg.com
#!/bin/bash

GFWLIST=https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
PROXY=127.0.0.1:7070

cd `dirname "${BASH_SOURCE[0]}"`
echo "Downloading gfwlist from $GFWLIST"
curl "$GFWLIST" --socks5-hostname "$PROXY" > /tmp/gfwlist.txt
/usr/local/bin/gfwlist2pac \
    --input /tmp/gfwlist.txt \
    --file proxy.pac \
    --proxy "SOCKS5 $PROXY; SOCKS $PROXY; DIRECT" \
    --user-rule user_rule.txt

rm -f /tmp/gfwlist.txt