/gopac

a tool to generate pac from gfwlist implements with go

Primary LanguageGoMIT LicenseMIT

Gopac

A tool to generate pac from gfwlist implements with go

Installation

Make sure you have a working Go environment. Go version 1.8+ is supported. See the install instructions for Go.

To install cli, simply run:

$ go get -u github.com/hahasong/gopac

# build
$ cd $GOPATH/src/github.com/hahasong/gopac
$ go build

Usage

-f, --file string       path to output pac (default "proxy.pac")
-i, --input string      path to gfwlist
    --precise           use adblock plus algorithm instead of O(1)
                        lookup
-p, --proxy string      the proxy parameter in the pac file, 
                        for example, "SOCKS5 127.0.0.1:1080;" (default "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT")
    --tld               force updating tld list, best no more than
                        once per month
    --user-rule string  user rule file, which will be appended to
                        gfwlist

Example

$ ./gopac  # run in fast mode use default parameters
$ ./gopac -f proxy_abp.pac --precise  # run in precise mode and output file 'proxy_abp.pac'
$ ./gopac --user-rule user-rule.txt  # merge user-rule.txt content to gfwlist