asteroidman / wallproxy-plus

Automatically exported from code.google.com/p/wallproxy-plus
1 stars 0 forks source link

求作者帮忙纠错 #515

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
[listen]
; 监听 IP 及端口 (可以是本地回环地址 127.0.0.1, 
本地局域网地址或互联网地址)
ip = 0.0.0.0
port = 8086

; WEB 配置界面登录户名, 密码
web_username = heeroyuyj
web_password = heeroyuyj

; 是否对本机访问 WEB 配置界面也要求认证
web_authlocal = 0

; 代理用户名, 密码 (共享给他人使用时的额外验证, 
不启用的话可留空)
username =
password =

; 是否禁用 Socks4 / Socks5 代理功能 (无论是否禁用, 使用 GAE / 
PAAS 服务端将无法作为真正的 Socks4 / Socks5 代理工作!)
disable_socks4 = 0
disable_socks5 = 0

; 代理使用 Basic 认证还是 Digest 认证
basic_auth = 1

; 是否使用通配符证书 (生成的证书文件更少)
cert_wildcard = 1

; 更新 PAC 时可能没联网, 等待多少秒再更新
tasks_delay = 0

[pac]
; 是否启用自动代理功能
enable = 1

; 注释掉 file = proxy.pac 将使得 WallProxy 工作在 [listen]port (默认 
port 是 8086) 的智能代理模式, 取消注释则使得 WallProxy 
工作在浏览器的 PAC 模式 (此时 8086 智能代理失效)
;file = proxy.pac

; 智能代理模式: https = 0 时全走直连, 证书非伪造, 
但也不能让无法访问的 https 走代理; = 1 时全走 fake_https, 
证书全伪造, 能让无法访问的 https 走代理; = 2 时根据 
rulelist/iplist 规则判断, 部分走直连, 部分走 fake_https, 
证书部分伪造, 部分无法访问且不在规则中的 https 
可能无法走代理
https_mode = 2

; 默认代理 (default = ) 
不匹配任何规则时的代理|解析出的地址是 IPv6 
时的代理|解析 IP 失败时的代理 (后两种只在使用 iplist 
时用到)
; 不带 py_ 的与 PAC 脚本中定义的 proxy 写法相同, 例如直连是 
DIRECT, http 代理是 PROXY *:8087 (* 表示自适应监听 IP, 端口)
; 带 py_ 的表示 WallProxy 的插件, 可选值有 FORWARD|GAE|PAAS 
(如果设置多个 PAAS, 还可以 PAAS1, PAAS2...)
;default = DIRECT|DIRECT|DIRECT
;py_default = FORWARD|FORWARD|FORWARD

; URL 规则在线列表或本地文件 (多个文件用 | 分隔)
rulelist = 
https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt|userlist.ini|yj.i
ni

; IP 规则在线列表或本地文件 (支持 xxx.xxx.xxx.xxx/mask 或 
xxx.xxx.xxx.xxx|count 格式的 IP 范围表示)
iplist =

; 如果默认代理不是 DIRECT, 或者有三个及三个以上的代理, 
需要使用以下写法 (iplist 类似)
;rulelist = !rulelist
;iplist = !iplist

;[rulelist]
;PROXY *:8087;DIRECT = gaelist.ini
;PROXY *:8088;DIRECT = paaslist.ini

;[py_rulelist]
;GAE = gaelist.ini
;PAAS = paaslist.ini

[gae]
; 是否启用GAE服务端
enable = 1

; 服务端的 appid (多个 appid 用 | 分隔, 数量不限)
appid = ******

; 防盗用密码 (如要使用, 必须与 server\python\wsgi.py 中 
__password__ 的密码相同)
password =

; 单独监听端口以便通过 PAC 或浏览器扩展调度
listen = 8087

; 服务端路径
path = /fetch.py

; Google 访问策略, 对应后面的 [google_cn], [google_hk] 及 
[google_ipv6]
profile = google_hk

; 分段下载时每个资源可用最大线程数 (max_threads = 0 时按 
appid 数量自动确定, 但上限不超过 10)
max_threads = 10

; 8087 端口是否也应用 profile 描述的 Google 访问策略 
(不应用将全走 GAE, 应用将按策略对部分进行直连, 8086 
总是应用的)
find_handler = 1

; fetch_mode = 0 时平滑缓冲 (边读边写), 但无法确保稳定性; = 1 
或 2 时可确保稳定性 (全部读完再写或分段下载读完再写, 
其它边读边写), 但无法保证平滑缓冲; 
建议在网络稳定时设置为 0, 不稳定时则设置为 1 或 2
fetch_mode = 0

; 是否通过代理连接 GAE, 默认使用 [proxy] 的设置
;proxy = http://user:pwd@111.111.111.111

[google_cn]
;满足 sites 的走 hosts 规则, 满足 forcehttps 的强制走 https 规则, 
有些满足 sites 或 forcehttps 的 Google 网站走这些 hosts 或强制 
https 会出问题, 所以就有了 withgae 来排除这些问题, 
无法直连的提交到 gfwlist 或加到 userlist.ini 即可, 
要节约流量走 hosts 规则的, 自己维护

; 走 http 还是 https
mode = https

; 映射 sites 描述的域名到 hosts 描述的 IP (注意 sites 实际上与 
[hosts] 实现相同)
hosts = 
203.208.46.1|203.208.46.2|203.208.46.3|203.208.46.4|203.208.46.5|203.208.46.6|20
3.208.46.7|203.208.46.8|203.208.47.1|203.208.47.2|203.208.47.3|203.208.47.4|203.
208.47.5|203.208.47.6|203.208.47.7|203.208.47.8|203.208.47.160|203.208.47.161|20
3.208.47.162|203.208.47.163|203.208.47.164|203.208.47.165|203.208.47.166|203.208
.47.167
sites = .appspot.com|.googlecode.com|.googlegroups.com|ssl.google-analytics.com

; 强制走 https 防止 reset (支持 URL RuleList 写法)
forcehttps = 
.google.com|www.google.com.hk|.googlecode.com|.googleusercontent.com|developer.a
ndroid.com

; 部分满足 forcehttps 的网站强制 https 可能出现问题, 
例如重定向异常, 通过 noforcehttps 排除 (支持 URL RuleList 写法)
noforcehttps = 
books.google.com|translate.google.com|scholar.google.com|http://www.google.com*/
imgres?|http://www.google.com*/translate_t?|feedproxy.google.com|picasa.google.c
om

; 部分满足 sites 的网站走 hosts 会出现问题, 例如 404, 强制走 
GAE 来排除 (支持 URL RuleList 写法)
withgae = 
plus.google.com|apis.google.com|c.docs.google.com|autoproxy-gfwlist.googlecode.c
om|translate.google.com|kuaidial.googlecode.com

[google_hk]
; 走 http 还是 https
mode = https

; 映射 sites 描述的域名到 hosts 描述的 IP (注意 sites 实际上与 
[hosts] 实现相同)
hosts = 
www.google.com|mail.google.com|74.125.128.45|74.125.128.32|74.125.128.65|74.125.
128.114|74.125.128.51|74.125.128.54|74.125.128.199|74.125.128.84|74.125.128.59|7
4.125.128.50|74.125.128.104|74.125.128.35|74.125.128.61|74.125.128.154|74.125.12
8.142|74.125.128.31|74.125.128.156|74.125.128.19|74.125.128.96|74.125.128.117
sites = 
.appspot.com|.google.com|.googlecode.com|.googleusercontent.com|.googlegroups.co
m|.google-analytics.com|.gstatic.com

; 强制走 https 防止 reset (支持 URL RuleList 写法)
forcehttps = 
http://www.google.com*/search?|http://www.google.com/reader/|code.google.com

; 部分满足 forcehttps 的网站强制 https 可能出现问题, 
例如重定向异常, 通过 noforcehttps 排除 (支持 URL RuleList 写法)
noforcehttps =

; 部分满足 sites 的网站走 hosts 会出现问题, 例如 404, 强制走 
GAE 来排除 (支持 URL RuleList 写法)
withgae = 
c.docs.google.com|translate.google.com|play.google.com|http*://books.google.com/
books?id=

[google_ipv6]
; 走 http 还是 https
mode = http

; 映射 sites 描述的域名到 hosts 描述的 IP (注意 sites 实际上与 
[hosts] 实现相同)
hosts = ipv6.google.com|2404:6800:8005::2f|2a00:1450:8006::30|2404:6800:8005::84
sites = 
.appspot.com|.google.com|.googleusercontent.com|.googleapis.com|.google-analytic
s.com|.googlecode.com|.google.com.hk|.googlegroups.com

; 强制走 https 防止 reset (支持 URL RuleList 写法)
forcehttps = 
groups.google.com|code.google.com|mail.google.com|docs.google.com|profiles.googl
e.com|developer.android.com

; 部分满足 sites 的网站走 hosts 会出现问题, 例如 404, 强制走 
GAE 来排除 (支持 URL RuleList 写法)
withgae =

[hosts]
; 是否启用 hosts 规则
enable = 1

; 是否对满足 crlf_rules 的请求使用 crlf 功能
crlf = 1
crlf_rules = /^https?:\/\/[^\/]+\.c\.youtube\.com\/liveplay\?/ \n 
/^https?:\/\/upload\.youtube\.com\// \n 
/^https?:\/\/www\.youtube\.com\/upload\//

; 是否使用远程 DNS 解析 [google_xx]hosts 或 [hosts] 中的域名 
(默认 8.8.8.8 或 8.8.4.4)
dns = 8.8.4.4

; 由远程 DNS 解析的域名 (支持泛域名, 优先级高于 hosts)
resolve = talk.google.com|talkx.l.google.com|.youtube.com

;hosts 映射, 支持多个映射到多个 (空格分隔) (添加 
accounts.google.com clients4.google.com 用于解决 iOS 上 Chrome 
无法登录 Google 账号的问题)

; 添加以下 URL 防止域名解析阻塞
www.baidu.com = www.baidu.com

;请求可能会转给 GAE/PAAS 插件处理, 从而导致 hosts 设置无效 
(观看直播只能走 hosts, 不能走 GAE), 设置 rules 
指定哪些情况走 hosts (URL RuleList 规则)
rules =

; 在 proxy.ini 中是将多个规则用 \n 隔开, 
多了以后影响可读性, 可通过以下方式从指定文件获取
;rules = !hostsrules.ini

[autorange]
; 是否启用自动多线程获取
enable = 1

; 域名匹配 hosts 时自动加 Range
hosts = 
.c.youtube.com|.c.docs.google.com|.googlevideo.com|av.vimeo.com|smile-*.nicovide
o.jp|video.*.fbcdn.net|s*.last.fm|x*.last.fm

; URL 满足 rules 时自动加 Range (写法同 [hosts]rules)
rules = 
/^https?:\/\/[^\/]+\/[^?]+\.(?:avi|exe|f4v|flv|hlv|m4v|m4a|mp4|mp3|ogg|rar|zip)(
?:$|\?)/

; 分段下载每段最大长度, 首次读取长度, 后续每次读写长度
maxsize = 1048576
waitsize = 524288
bufsize = 131072

[proxy]
; 是否需要通过其它代理上网 (即使设置全局代理, [pac] 
智能代理模式仍然使用 DIRECT 作为直连标识)
enable = 0

; 代理地址
host = 10.124.4.19
port = 8080

; 代理账号 (如果是 ntlm 等没有直接支持的认证方式, 将 
username 设为空)
username =
password =

[paas]
; 是否启用 PAAS 服务端
enable = 0

; 防盗用 key
password = 123456

; 单独监听端口以便通过 PAC 或浏览器扩展调度
listen = 8088

; 服务端地址
fetchserver = http://demo1.app.com/|http://demo2.app.com/

; 是否通过代理连接 PAAS, 默认使用 [proxy] 的设置 (可指定为 
GAE 监听地址从而利用 GAE 加速 PAAS 访问并弥补 GAE 不足)
;proxy = http://127.0.0.1:8086

[socks5]
; 含义基本同 [paas], 但为另一种服务端, 几乎没有支持平台, 
未测
enable = 0
password = 123456
listen = 8089
fetchserver = http://demo.app.com/socks5
;proxy = http://127.0.0.1:8087

[urlfetch]
; 是否使用 Keep-alive 连接资源
keep_alive = 1

; 默认超时 (单位秒, 0 表示不超时, -1 使用默认值)
timeout = -1

; 转发超时
fwd_timeout = -1

; 服务端超时
gae_timeout = -1

; 是否添加 \r\n 连接服务端
gae_crlf = 0

; 是否显示额外信息 (0, 1)
debug = 0

[useragent]
; 是否启用 useragent 改写
enable = 1

; 原 useragent 满足 match 指定的正则式且网址满足 rules 指定的 
URL 规则才改写 (目前用于改善移动设备访问 Twitter 遇到的 403 
问题)
match = (?i)mobile
rules = ||twitter.com

; 改写为以下 useragent
string = Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.4 (KHTML, like Gecko) 
Chrome/22.0.1229.94 Safari/537.4

[fetchmax]
; 本地重试次数
;local =

; 服务端重试次数
;server =

; 以下兼容旧版插件, 这里 ini 转 py 只支持部分参数, 
.appspot.com 的 hosts 请修改 [hosts] 部分;
; 独立的 proxy, max_threads 之类的参数修改 config.py
; 参数意思与旧版相同, 未使用旧版 GAE / PHP 者请无视
;[gaeproxy]/[forold]/[goagent]/[simple]/[simple2]
; 如果 URL 未设置, 则通过 appid 生成 GAE 的 URL, 多个用 | 分隔
;appid = appid1|appid2

;url = http://demo1.app.com/|http://demo2.app.com/

;crypto = AES-CBC-32

;password = password

;代理, 多个用 | 分隔, [proxy] 中的设置为 default, 无代理为 
none, 留空与上一个相同
;proxy = http://127.0.0.1:8087

; 单独监听端口以便通过 PAC 或浏览器扩展调度, 不支持多个
;listen = 8088

; 以下三个参数意思与旧版相同, 不支持多个
;max_threads =
;range0 =
;range =

Original issue reported on code.google.com by heeroyuyj on 25 Nov 2012 at 3:57

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
我中午抽空又试了下, 我的配置文件应该是没问题的 
(和默认的比对, 貌似没发现哪里有写错)

目前遇到的一些与 Google 相关的 URL 
打开反应很慢甚至偶尔超时应该是因为 proxy.pac 的问题...

Original comment by heeroyuyj on 26 Nov 2012 at 5:49

GoogleCodeExporter commented 9 years ago
v2.1.10 
增加truehttps与notruehttps选项,在userlist.ini中将指定请求转给wal
lproxy,如果域名满足truehttps但不满足notruehttps,则不使用伪造
证书的https。

Original comment by www.eh...@gmail.com on 26 Nov 2012 at 4:28

GoogleCodeExporter commented 9 years ago
还是有点不明白, 能稍微举个例子讲解一下吗?

Original comment by heeroyuyj on 27 Nov 2012 at 4:23

GoogleCodeExporter commented 9 years ago
而且 proxy.pac 我觉得用起来还真的是问题多多

打开 www.google.com, 我在 Chrome 里是无障碍直接打开, gmail.com 
也没问题

换到 IE, 指定的也是 proxy.pac, 结果上面两个就一直 loading, 
没任何反应, 等很久都不出东西, WallProxy 
的命令行窗口里也没有任何 FWD 之类的信息出现

Original comment by heeroyuyj on 27 Nov 2012 at 4:35

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
另外, 我在 debug 0 的情况下偶尔会看到转发失败 
(之前优酷上偶尔也会有, 这个在别的 Issue 中提到过)

今天看到新浪微博也有这个情况

Forward http://p.vip.weibo.com/j?uids=2287083053,2291941260&uid=1496229834: 
[Errno 10060] 
由于连接方在一段时间后没有正确答复或连接的主机没有反��
�,连接尝试失败。, try http_failed_handler.
127.0.0.1 - [2012-11-27 12:37:38] GAE "GET 
http://p.vip.weibo.com/j?uids=2287083053,2291941260&uid=1496229834 HTTP/1.1" 
500 398

这种转发失败, 是意外情况吗?

Original comment by heeroyuyj on 27 Nov 2012 at 4:40

GoogleCodeExporter commented 9 years ago
然后就是 resolve = talk.google.com|talkx.l.google.com|.youtube.com

WallProxy 开启后只会解析到 talkx.l.google.com , 并不会解析 
.youtube.com

Original comment by heeroyuyj on 27 Nov 2012 at 9:15

GoogleCodeExporter commented 9 years ago
.youtube.com这种泛域名是在直连时遇到哪个解析哪个的,例如��
�直播时。

Original comment by www.eh...@gmail.com on 27 Nov 2012 at 10:34

GoogleCodeExporter commented 9 years ago
非100%转发失败的不用管,有时候直连或PAC也会失败但你看不�
��而已。
所有系统所有浏览器的pac问题先自己写个稍微简单的做对照��
�果也这样就不要反馈了,另外Google“IE pac cache”。

Original comment by www.eh...@gmail.com on 27 Nov 2012 at 10:41

GoogleCodeExporter commented 9 years ago
噢, 好吧, 

"如果域名满足truehttps但不满足notruehttps,则不使用伪造证书��
�https。"

这个能举个例子吗, 不是明白具体用法

Original comment by heeroyuyj on 27 Nov 2012 at 11:09

GoogleCodeExporter commented 9 years ago
Moved to: Issue wallproxy:272

Original comment by heeroyuyj on 2 Dec 2012 at 4:10