Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull #1

Open
wants to merge 70 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
a8fa8b2
support user defined rules; close #2
clowwindy Mar 18, 2014
6509aea
update readme
clowwindy Mar 18, 2014
73032f8
add performance test
clowwindy Mar 18, 2014
fa06252
add performance test
clowwindy Mar 18, 2014
f651a30
add performance test
clowwindy Mar 18, 2014
f8d9e66
fix avg result in performance test
clowwindy Mar 18, 2014
c6f53aa
20% faster
clowwindy Mar 18, 2014
ae3ee4a
reduce invalid entries using tld data
clowwindy Mar 18, 2014
6d21bf2
bump version
clowwindy Mar 18, 2014
082c364
add comparison test with switchysharp pac
clowwindy Mar 18, 2014
81b694e
add comparison test with switchysharp pac
clowwindy Mar 18, 2014
02ab75e
add comparison test with switchysharp pac
clowwindy Mar 18, 2014
313aba9
download gfwlist if -i option is not provided; close #4
clowwindy Mar 19, 2014
01e14d7
Update proxy.pac
clowwindy Mar 22, 2014
5190b4a
add googleapis.com
clowwindy Mar 28, 2014
ad9ca2e
Merge remote-tracking branch 'origin/master'
clowwindy Mar 28, 2014
224a7b8
update test
clowwindy Mar 28, 2014
b5900fd
Update README.md
clowwindy Apr 7, 2014
897f368
Update README.md
clowwindy Apr 7, 2014
1564d40
proxy.pac 15%-20% faster
Mudenng May 7, 2014
fef534a
Merge pull request #8 from Mudenng/master
clowwindy May 7, 2014
f7dc319
update
clowwindy Jun 8, 2014
cd8594b
update
clowwindy Jun 8, 2014
512b8c0
another 10% faster
clowwindy Jun 9, 2014
3899494
yet another 10% faster
clowwindy Jun 9, 2014
6ec0e10
close #11
clowwindy Jun 13, 2014
1a4296e
bump
clowwindy Jun 13, 2014
15d68e8
run test again
clowwindy Jun 30, 2014
e57f832
Allow to use URL for user rule, such as a raw gist
pzgz Jul 10, 2014
5fba81f
Merge pull request #15 from pzgz/master
clowwindy Jul 14, 2014
50c2d24
fix infinite loop when the host begins with '.'
clowwindy Aug 26, 2014
e8841fc
close #17
clowwindy Oct 4, 2014
57b70e4
close #14
clowwindy Oct 4, 2014
cfe0ec7
remove print
clowwindy Oct 4, 2014
8f18dd1
bump
clowwindy Oct 4, 2014
1f08237
fix pep8
clowwindy Oct 4, 2014
80fb2eb
update pac
clowwindy Nov 19, 2014
d59b87e
add precise mode
clowwindy Nov 19, 2014
fd856e6
update pac
clowwindy Nov 19, 2014
edaed27
update rules
clowwindy Nov 19, 2014
3c34c7a
remove grammar that IE hasn't seen before
clowwindy Nov 21, 2014
9a598de
update pac
clowwindy Nov 21, 2014
64e55a0
fix IE
clowwindy Nov 21, 2014
c17ffa9
refine tests
clowwindy Nov 21, 2014
6e1c389
bump
clowwindy Nov 21, 2014
7d84adf
fix unit
clowwindy Nov 21, 2014
e32fc37
Update README.md
clowwindy Nov 21, 2014
39e3da9
Update README.md
clowwindy Nov 21, 2014
ef0af21
add more tests
clowwindy Nov 30, 2014
b343845
add coverage test
clowwindy Dec 11, 2014
707cf19
fix coverage
clowwindy Dec 11, 2014
517d60a
add html output for coverage
clowwindy Dec 28, 2014
19a56c1
add coverage badge
clowwindy Dec 28, 2014
3d3789c
update gfwlist
clowwindy Jan 5, 2015
a25138c
update pac
clowwindy Jan 5, 2015
5b10742
bump
clowwindy Jan 6, 2015
005b67b
Compatible with IE11
GangZhuo Jan 19, 2015
92a3b7b
Merge pull request #30 from GangZhuo/master
clowwindy Jan 19, 2015
f8864b5
bump
clowwindy Jan 20, 2015
2193e4b
Create CONTRIBUTING.md
clowwindy Jan 23, 2015
687c6a0
Update CONTRIBUTING.md
clowwindy Jan 23, 2015
0b0ed76
Remove 140+ duplicated domains
liruqi Jan 31, 2015
ed97afc
Sort domains for better search & diff
liruqi Jan 31, 2015
624d661
Try to fix PEP8 violations
liruqi Jan 31, 2015
0a1da2b
Try to fix PEP8 violations
liruqi Jan 31, 2015
976b29b
Try to fix PEP8 violations
liruqi Jan 31, 2015
da08cf0
Merge pull request #38 from liruqi/master
clowwindy Jan 31, 2015
91165f6
Bugfix for *.hk & *.tw domains
liruqi Feb 1, 2015
2a91a4e
Merge pull request #39 from liruqi/patch-1
clowwindy Feb 1, 2015
d3ed717
lint code
clowwindy Feb 1, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
*.py[co]

# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg

# Installer logs
pip-log.txt

# Unit test / coverage reports
htmlcov
.coverage
.tox
test/proxy_nobase64.pac

#Translations
*.mo

#Mr Developer
.mr.developer.cfg

.DS_Store

7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
language: python
language: python
python:
- 2.6
- 2.7
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq nodejs
- pip install pep8 pyflakes coverage
script:
- cd test && ./test.sh
- pep8 .
- pyflakes .
- cd test && ./test.sh
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Notice
------

This project does not maintain a list. It's just a tool that converts
GFWList into PAC. Please report issues about the list to GFWList.

Pull Requests
-------------

1. Pull requests are welcome. If you would like to add a large feature
or make a significant change, make sure to open an issue to discuss with
people first.
2. Follow PEP8.
3. Make sure to pass the unit tests.

Issues
------

1. Only bugs and feature requests are accepted here.
2. We'll only work on important features. If the feature you're asking only
benefits a few people, you'd better implement the feature yourself and send us
a pull request, or ask some of your friends to do so.
3. We don't answer questions of any other types here. Since very few people
are watching the issue tracker here, you'll probably get no help from here.
Get help from forums or [mailing lists].
4. Issues in languages other than English will be Google translated into English
later.


[mailing lists]: https://groups.google.com/forum/#!forum/shadowsocks
44 changes: 40 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
GFWList2PAC
===========

[![Build Status](https://travis-ci.org/clowwindy/gfwlist2pac.png?branch=master)](https://travis-ci.org/clowwindy/gfwlist2pac)
[![PyPI version]][PyPI]
[![Build Status]][Travis CI]
[![Coverage Status]][Coverage]

Generate O(1) PAC file from gfwlist.
Generate fast PAC file from gfwlist. Examples: [fast mode] / [precise mode].

pip install gfwlist2pac
Fast mode: use O(1) domain lookup

Precise mode: use adblock plus engine


### Usage

usage: gfwlist2pac [-h] -i GFWLIST -f PAC -p PROXY
pip install gfwlist2pac

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

optional arguments:
-h, --help show this help message and exit
-i GFWLIST, --input GFWLIST
Expand All @@ -17,3 +27,29 @@ Generate O(1) PAC file from gfwlist.
-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
--precise use adblock plus algorithm instead of O(1) lookup

### Performance

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

Testing fast mode pac generated by gfwlist2pac
avg: 0.50us

Testing precise mode pac generated by gfwlist2pac
avg: 1.66us

Testing pac generated by switchysharp
avg: 952.99us


[Build Status]: https://img.shields.io/travis/clowwindy/gfwlist2pac/master.svg?style=flat
[Coverage Status]: http://192.81.132.184/result/gfwlist2pac
[Coverage]: http://192.81.132.184/job/gfwlist2pac/ws/htmlcov/index.html
[Travis CI]: https://travis-ci.org/clowwindy/gfwlist2pac
[PyPI]: https://pypi.python.org/pypi/gfwlist2pac
[PyPI version]: https://img.shields.io/pypi/v/gfwlist2pac.svg?style=flat
[fast mode]: https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy.pac
[precise mode]: https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy_abp.pac
58 changes: 58 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
GFWList2PAC
===========

|PyPI version| |Build Status| |Coverage Status|

Generate fast PAC file from gfwlist. Examples: `fast
mode <https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy.pac>`__
/ `precise
mode <https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy_abp.pac>`__.

Fast mode: use O(1) domain lookup

Precise mode: use adblock plus engine

Usage
~~~~~

::

pip install gfwlist2pac

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

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
--precise use adblock plus algorithm instead of O(1) lookup

Performance
~~~~~~~~~~~

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

::

Testing fast mode pac generated by gfwlist2pac
avg: 0.50us

Testing precise mode pac generated by gfwlist2pac
avg: 1.66us

Testing pac generated by switchysharp
avg: 952.99us

.. |PyPI version| image:: https://img.shields.io/pypi/v/gfwlist2pac.svg?style=flat
:target: https://pypi.python.org/pypi/gfwlist2pac
.. |Build Status| image:: https://img.shields.io/travis/clowwindy/gfwlist2pac/master.svg?style=flat
:target: https://travis-ci.org/clowwindy/gfwlist2pac
.. |Coverage Status| image:: http://192.81.132.184/result/gfwlist2pac
:target: http://192.81.132.184/job/gfwlist2pac/ws/htmlcov/index.html
Loading