{"repo":"JinnLynn/genpac","free":true,"listed":false,"github":"https://github.com/JinnLynn/genpac","clone":"git clone https://github.com/JinnLynn/genpac.git","description":"PAC/Dnsmasq/Wingy file Generator, working with gfwlist, support custom rules.","language":"Python","stars":2187,"topics":["gfwlist","pypi","python","pac","gfw","dnsmasq","wingy"],"license":"MIT","category":"dev-tools","readme_excerpt":"GenPAC [![pypi-version]][pypi] ![pypi-pyversions] [![pypi-license]][pypi] [![dev-version]](https://github.com/JinnLynn/genpac/tree/dev) 基于[gfwlist][]的多种代理软件配置文件生成工具，支持自定义规则 目前支持的格式有: PAC, Dnsmasq, V2Ray, Shadowsocks, Quantumult X, Shadowrocket, Surge, Wingy, Potatso 和 IP (国别IP列表), List (gfwlist格式的列表), Copy (复制源)。示例 注意 : 生成后的规则不会匹配网址路径，只会检查域名(包括子域名)，如 http://sub2.sub1.domain.com/path/to/file.ext = sub2.sub1.domain.com 安装 使用方法 命令行形式 web服务形式 支持以web形式自动生成及输出: 配置参考见[example/server/config.ini][] 配置文件 支持通过 --config 参数读入配置信息，配置文件书写方法可参考[example/config.ini][] 自定义规则 支持通过 --user-rule 自定义单个规则或 --user-rule-from 读入自定义规则文件，这两个参数均可重复使用。 自定义规则文件可参考[example/user-rules.txt][] 自定义规则的语法与gfwlist相同，使用AdBlock Plus过滤规则( http://adblockplus.org/en/filters )，简述如下: 1. 通配符支持，如 .example.com/ 实际书写时可省略 为 .example.com/ 2. 正则表达式支持，以 \\ 开始和结束，如 \\[\\w]+:\\/\\/example.com\\\\ 3. 例外规则 @@ ，如 @@ .example.com/ 满足 @@ 后规则的地址不使用代理 4. 匹配地址开始和结尾 ，如 http://example.com 、 example.com 分别表示以 http://example.com 开始和以 example.com 结束的地址 5. 标记，如 example.com 则 http://example.com https://example.com ftp://example.com 等地址均满足条件 6. 注释 ! 如 ! Comment 配置自定义规则时需谨慎，尽量避免与gfwlist产生冲突，或将一些本不需要代理的网址添加到代理列表 规则优先级从高到底为: user-rule user-rule-from gfwlist FAQ 1. 出现 fetch gfwlist fail. 错误 gfwlist是在线获取，某些情况下可能被和谐或其它原因导致获取失败，可以通过以下几种方法解决该问题： 使用 --proxy 参数，通过代理获取gfwlist 通过其它方式下载到本地，再通过 --gfwlist-local 加载 使用参数 --gfwlist-url=- 不进行在线获取，这种情况下你只能使用自定义规则 1. gfwlist获取代理使用失败 检查--proxy参数或配置proxy值是格式否符合 PROTOCOL://HOST:POST ，如 socks5://127.0.0.1:1080、http://127.0.0.1:80","default_branch":null,"files":null,"tree":[],"storefront":"/r/JinnLynn","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/JinnLynn/genpac/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}