Convert GFWList into O(1) PAC file
Pull request Compare This branch is 36 commits ahead of itcook:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
gfwlist2pac
test
.travis.yml
LICENSE
README.md
README.rst
effective_tld_names.dat
setup.py

README.md

GFWList2PAC

PyPI version Build Status

Generate O(1) PAC file from gfwlist.

Usage

pip install gfwlist2pac

usage: gfwlist2pac [-h] [-i GFWLIST] -f PAC -p PROXY [--user-rule USER_RULE]

optional arguments:
  -h, --help            show this help message and exit
  -i GFWLIST, --input GFWLIST
                        path to gfwlist
  -f PAC, --file PAC    path to output pac
  -p PROXY, --proxy PROXY
                        the proxy parameter in the pac file, for example,
                        "SOCKS5 127.0.0.1:1080;"
  --user-rule USER_RULE
                        user rule file, which will be appended to gfwlist

Performance

An example of generated PAC file is here.

The PAC generated by GFWList2PAC is 1700x faster than SwitchySharp.

Testing pac generated by gfwlist2pac
total: 35.115832999999995ms
avg: 0.5074542341040461ns

Testing pac generated by switchysharp
total: 58800.679729ms
avg: 849.72080533237ns