Skip to content

cuber/gfwlist2pac-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gfwlist2pac-shell

Translate the gfwlist in base64 to efficient pac file with X-level domain validation

This project is mainly created by @clowwindy via python

This version is just an implementation of pure shell

Generate O(1) PAC file from gfwlist.

Dependency

A socks5 proxy is needed to download the gfwlist.

You can make one via shadowsocks or ssh -D, the PROXY will be used to generate the pac file as well, so it should be an commonly used local address.

# socks5 proxy ssh -D, shadowsocks or others
PROXY="127.0.0.1:7070"

Beacuse of the limitation of shell, i migration to zsh, you can easily install with apt-get, yum, pacman in any kind of linux platform.

The cli version of curl, openssl which was integrated into most popular linux version.

You can specify the tools customly.

# curl & openssl cli command path
CURL=/usr/bin/curl
CURLOPT=(-s -x socks5://$PROXY)
OPENSSL=/usr/bin/openssl

Custom

You can add some domains to custom.txt, it will be added into the pac file automatically. One domain per-line.

github.com
dropbox.com
linode.com
stackoverflow.com
linost.com
eigenlogik.com
iceimg.com
jetbrains.com
instagram.com
linkedin.com
agilebits.com
godaddy.com
startssl.com
btdigg.org
digitalattackmap.com
igvita.com
apache.org
jquery.com
speedtest.net

Usage

after all dependency ready

Usage. ./gfw.sh [filename.pac]

Eg. ./gfw.sh release/proxy.pac

The proxy.pac will be generated to release/proxy.pac

Performance

An example of generated PAC file is [here] 1.

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

Testing pac generated by gfwlist2pac
total: 46.411584ms
avg: 0.6706876300578034ns

Testing pac generated by switchsharp
total: 58828.813476ms
avg: 850.1273623699423ns

About

Translate the gfwlist in base64 to efficient pac file

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages