Gappproxy 分支版本 Gappproxy2 发布

{ 撰文/fcicq }

Gappproxy2 是 Gappproxy 的一个分支版本. 作者 fcicq.
代码授权与 Gappproxy 相同, 均为 GPLv3. 感谢原作者 XiaoGang.

gappproxy2 的服务器端 fetch.py 与原 gappproxy 不兼容.
安装方法和 gappproxy 一样, 如果你有准备好的 GAE app 的话, 替换 fetch.py
并更换客户端即可.

推荐在 app.yaml (未提供) 中加入 secure: optional.
IPv6 用户推荐使用 hosts 文件加密直连 GAE.
欢迎教育网用户及其他有相关需求的用户测试.

相对原版改动之处较多, 详情请见原文 Changelog.
因条件所限未能提供 Win32 GUI 执行文件.

Gappproxy2 FAQ

下载: gappproxy2.tar.gz

{ Source }

Read More:

  • » No related posts

33 Comments

  1. 1 Iven Commented @ 2010-05-19 14:03Reply to this comment

    最近没看到 @rmbus,本人表示很寂寞……

  2. 2 Blackdream Commented @ 2010-05-19 14:06Reply to this comment

    那么她对比原gap。有何差别?

  3. 3 Leos Commented @ 2010-05-19 14:06Reply to this comment

    说能具体的介绍一下Gappproxy ?

  4. 4 Iven Commented @ 2010-05-19 14:07Reply to this comment

    说实话,感觉现在的改进不大,更想知道在这个版本周期内将会有什么特性出现……

  5. 5 PT Commented @ 2010-05-19 14:14Reply to this comment

    没什么区别。话说从某此YouTube升级之后GAppProxy就不能看Youtube了,大家有没有遇到这个情况

    PS: LinuxTOY的界面换了,很不适应...

  6. 6 gogo Commented @ 2010-05-19 14:28Reply to this comment

    @PT: 102版一直能看。

  7. 7 pi1ot Commented @ 2010-05-19 14:39Reply to this comment

    之前的gap也能看youtube,至少昨天还能看

  8. 8 Blackdream Commented @ 2010-05-19 14:55Reply to this comment

    @PT:

    102的版本。在我这里不能看的几率大概是20%。而且,有时候碰到360P不能播放,切换到480P,也可以播放。总之成功率很高。

    proxy.py在修改几行。具体是哪几行我自己也不晓得了。paste到这里,你自己参考一下我的proxy.py,希望对你有帮助:

    http://paste.pocoo.org/show/215590/

    这个proxy.py和原先的proxy.py的最大差别就是,Direct Fetch : NO(永远是NO)

  9. 9 fcicq Commented @ 2010-05-19 15:39Reply to this comment

    偶的这个版本比较适合上论坛(POST 修正), 下文件(206 支持比原版好的多). 偶上 youtube 主要碰到的问题是 403 Forbidden, 但理论上没那么多问题. 如果有成功率下降的同学可以把 Fetch_Max = 2 改成 3.

    版本 0.99, 留点余地, 给 1.00 点空间 :D

    有想要新特性的就说出来吧.

  10. 10 Blackdream Commented @ 2010-05-19 16:09Reply to this comment

    @fcicq:

    https,不需要例外证书那种。哥,你懂的。

  11. 11 ynome Commented @ 2010-05-19 16:13Reply to this comment

    @Blackdream: @fcicq: https,不需要例外证书那种。哥,你懂的。

  12. 12 Iven Commented @ 2010-05-19 16:17Reply to this comment

    @fcicq: 呵呵,作者现身了……经过你这样一解释,看来还是有很多有用的改进的……之前的 ChangeLog 太专业了,没看懂……

  13. 13 rmbus Commented @ 2010-05-19 16:29Reply to this comment

    升级到了2以后就不能下载大于1M的文件了。目前看来比1.2要差,引入大量新bug

  14. 14 muzuiget Commented @ 2010-05-19 16:58Reply to this comment

    既然是分支版本,就应改别的名字吧,这个“Gappproxy2”很容易让人误会呀。

  15. 15 fcicq Commented @ 2010-05-19 17:03Reply to this comment

    要不引入一个 HEAD 机制? 发现部分服务器没有 Content-Range 的返回头, 原版碰到这样的问题实际上也一样. 不怕麻烦的同学可以两版并用...

    不能下载 1M 的文件可能是因为 GAE 到远程服务器网速不够快, 没有触发 ResponseTooLargeError. 这个问题知道了. 原版的检测朴素的过分了 :D 改回来?

    改成 2 次重试的原因是对网页浏览来说, 2 次足够了, 而且这样做之后 urlfetch 的次数由于 memcache 的存在能够小于页面访问次数. 这不仅是个好看的问题. urlfetch 本来免费数就比页面数要少.

    GAE urlfetch 的实际情况也和原来不一样了. 如果你重复同一个请求, 就算加长了 deadline 它可能也不会再干一次活了.

  16. 16 fcicq Commented @ 2010-05-19 17:11Reply to this comment

    @muzuiget 既然开了这个分支偶自会去维护. r102 "有年头" 了. :D

    看起来网页方面应该是没有太多问题. 大文件问题还是比较突出. 各位可以 HEAD 一下目标文件 (curl -I), 得到目标文件大小, 然后减去 1, 写成 http_proxy=127.0.0.1:8000 curl -r 0-[FILESIZE-1] uri 看看效果. 如果这个没问题的话偶就只要修一处就可以了.

  17. 17 灌水小鱼 Commented @ 2010-05-19 17:38Reply to this comment

    GAE就没申请成功过,朋友的手机号码都用遍了。

  18. 18 luc Commented @ 2010-05-19 18:12Reply to this comment

    @灌水小鱼: 可以直接申诉开通服务。

  19. 19 fcicq Commented @ 2010-05-19 23:29Reply to this comment

    已下载用户快速修复途径: proxy.py line 423, 424 行, 找到 "if content_length == 0:" 及 "return", 删除两行前面的 tab 各一个. 新版稍后发布, 无重大修正.

  20. 20 PT Commented @ 2010-05-20 1:01Reply to this comment

    收到,谢谢,我去对比一下

  21. 21 fcicq Commented @ 2010-05-20 7:33Reply to this comment

    原文件已于 2010.5.20 0:00 替换. 已经部署到 GAE 的同学可以只替换客户端 proxy.py 或使用上述快速修复.

  22. 22 spartan Commented @ 2010-05-20 8:42Reply to this comment

    不知道怎么样,咋办

  23. 23 fcicq Commented @ 2010-05-20 9:06Reply to this comment

    新补 Gappproxy2 FAQ 一个. http://www.fcicq.net/wp/?p=884

  24. 24 fcicq Commented @ 2010-05-20 11:09Reply to this comment

    测试版本, 测试另一种修复 206 断点续传的方法, 修正 HEAD 请求处理问题. 恢复了 gappproxy 原有的 Range-Request 测试方式. urlfetch 抓大文件的超时是挺讨厌的, 抓不着的话它会算 downloaderror 而不算 largeresponseerror. gappproxy2-0.99.2.tar.gz

  25. 25 沈觅仁 Commented @ 2010-05-20 17:58Reply to this comment

    试用了一下。网页浏览倒是很好了,但仿佛问题不少。

    SSL是一方面,另外,这个 http://gappproxy/status 怎么访问??gappproxy这种主机名还得额外绑定,多么麻烦。。。

  26. 26 fcicq Commented @ 2010-05-20 18:58Reply to this comment

    楼上: 这个... 既然它是 http 代理, 就不用多说了? http_proxy=127.0.0.1 wget http://gappproxy/status, 浏览器也一样.

  27. 27 supercyper Commented @ 2010-05-20 19:54Reply to this comment

    toy已经被墙。。。

  28. 28 宅人 Commented @ 2010-05-23 19:58Reply to this comment

    @muzuiget: 带GAppProxy字样明显可以借用GAppProxy的名气嘛。 其实WallProxy(http://code.google.com/p/wallproxy/ )也算是GAppProxy的一个分支版本,虽然刚开始说是GAppProxy的PHP实现,不过后来也上传了对GAP某些缺陷修复后的GAE版服务端(主要是去除了不必要的端口、Method限制,并修复了文件上传bug),该服务端兼容于GAP的客户端,当然了,最好还是使用WallProxy修改后的客户端。

  29. 29 宅人 Commented @ 2010-05-23 20:16Reply to this comment

    @fcicq: 其实POST修正你可以用cgi.parse_qs()函数自己解析self.request.body,不用Google提供的那个只适用于字符串的self.request.get()函数,这样可以减少你那约1/4的post上限损失吧。

  30. 30 fcicq Commented @ 2010-05-23 22:57Reply to this comment

    楼上: 遇到的实际上是 encoding 问题. 要想直接解决 contentlength != len(origpost_data) 的问题可能就不能再用 GAE 给的这个 wsgi 框架了. 当然要感谢你指的这个路, 不过这个改动也许就相当大了. 如果 encoding 的问题解决了, 偶当然愿意恢复原来的样式. header 和 content 的问题偶在测试中都遇到了, 所以都改成了 base64. 借名气的问题... 如果你偏要这样想, 偶也没什么可辩解的. 偶完成了提供代码的义务, 仅此而已.

  31. 31 宅人 Commented @ 2010-05-24 11:19Reply to this comment

    @fcicq: request = cgi.parseqs(self.request.body) for k in request: request[k] = request[k][-1] method = request.get('method') path = base64.b64decode(request.get('encodedpath')) headers = request.get('headers') postdata = request.get('postdata') 改动不大吧?之所以contentlength != len(origpostdata),就是因为origpost_data解析错误了,解析正确的话就不会这样。 '''出于安全性考虑,应用程序不能修改以下标头: * Content-Length * Host * Referer * Vary * Via * X-Forwarded-For 根据情况,由 App Engine 将这些标头设置为准确的值。例如,App Engine 通过请求数据计算 Content-Length 标头,并在发送之前将其添加到请求。''' 说借名气只是一句玩笑话~~

  32. 32 fcicq Commented @ 2010-05-24 18:02Reply to this comment

    慢? cgi.parseqs 属于不推荐用法了. 用 urlparse.parseqs 代替. request[k][-1] 是什么意思? 是去掉最后的 \n 吗? 暂时没试.

  33. 33 eagle Commented @ 2010-05-29 15:42Reply to this comment

    gappproxy不是不不能用了,