从0开始将wallproxyV1.0安装配置好

2011年3月21日 | 分类: 翻墙相关 | 标签: ,

V1.0版本安装配置说明
本wiki的目的
从0开始将wallproxyV1.0安装配置好

wallproxy需求

  1. 计算机装有windows或linux系统(对于mac,塞班,Android,iphone只能支持wallproxy部分功能,而且没有文档)
  2. 手机(接收验证码用,有GAE的app者可以跳过,)
  3. 所在网络有办法连接上如下网站:
  4. 1.下载wallproxy用 https://code.google.com/p/wallproxy/
    2.上传服务器端用 https://appengine.google.com/
    3.上传服务器端登录用 https://www.google.com/accounts/
    4.连接代理用 http://shell.appspot.com/
  5. 附录有对不满足上述条件的解决办法

内容

1.申请GAE的app

  1. 用浏览器访问https://appengine.google.com/
  2. 登录你的某个gmail,如果gmail帐号没有请点下面的”Create an account now”
  3. 点Create Application
  4. 输入你的手机号以验证
  5. 输入一个”Application Identifier”,下面的”app-id”,建议随机生成一个6位字母串(如”tmgszm”),以避免你的id被屏蔽
  6. “Application Title”,对于wallproxy来说无关紧要…
  7. 如果出现”Application Registered Successfully”即表示注册成功

注意事项:

  • 每个gmail帐号一共能生成10个app
  • 每个手机号只能验证成功一次
  • 某个app的管理权限可以与其他gmail帐号分享

2.上传wallproxy的服务器端至GAE

  1. 用浏览器访问http://code.google.com/appengine/downloads.html
  2. 下载你的操作系统的python版SDK
  3. 安装GAE的SDK
  4. 修改wallproxy服务端(一般是server文件夹)的app.yaml文件第一行
  5. application: app-id

将app-id用你第一步注册的id来代替(:号后面的空格不可少)

  1. 用GAE的SDK上传那个server文件夹

3.设置服务器端密码

  1. 先用浏览器访问http://you-app-id.appspot.com/fetch.php,如果出现跳转至twitter.com表明成功访问(即使twitter.com网站打不开也没事)
  2. 访问https://appengine.google.com/
  3. 选择对应的app-id
  4. 选择左边栏data->Datastore Viewer
  5. 上面的Query->By kind:选择WPConfig,(如果没有WPConfig请重试第一步,或者配置好客户端尝试代理一次.)
  6. 点击下面的id=xx连接进入配置页面
  7. siteKey为密码,输入一个密码即可,如:”TmgSzmfkw4bBZ”(英文,数字,字符,汉字,转义符…)(默认:””空)
  8. cryptomode为加密方法,可以不用修改,(默认:AES-CBC-32)

 

4.修改客户端配置文件

  1. 用文本编辑器(如UE,vim,word…)打开客户端目录(一般为local目录或者包含proxy.exe的目录)下的proxy.conf
  2. 修改下面部分的app-id为你注册的id,同样密码和加密方法也需要修改:

siteKey->key cryptomode->crypto 比服务端多一对引号

gaeproxy = [{
'url':'https://app-id.appspot.com/fetch.php',
'key':'',#此处使用默认密码
'crypto':'AES-CBC-32',
}]
  1. 下面是一个可以正常工作的样例(关闭host功能,关闭AutoProxy功能)
  2. # -*- coding: utf-8 -*-
    #上面第一行保证可以用汉字注释
    #设置本地服务端参数,修改后需要重启才能生效
    server['listen'] = ('', 8086) #监听地址
    server['log_file'] = '' #''不记录 None终端 filename文件
    server['daemon_threads'] = True #主线程退出后自动结束子线程
    
    #设置plugins,需要停用可在plugins['xxxx']='yyy'前面加#
    
    #效果类似于修改hosts
    hosts = {'.appspot.com':'www.google.cn'}
    #plugins['plugins.hosts'] = 'hosts'
    
    #指定GAE服务端,设置多个时后面的继承第一个的设置,所以后面的指定一个url就行了,
    #而且推荐这么设置,可设置参数有url、key、crypto、proxy、headers、range0、range、
    #max_threads,proxy设置格式与下面rawproxy中设置相同
    gaeproxy = [{
    'url':'https://app-id.appspot.com/fetch.php',
    'key':'',#此处使用默认密码
    'crypto':'AES-CBC-32',
    }]
    plugins['plugins.gaeproxy'] = 'gaeproxy'
    
    #在这里设置0.4.0版的服务端,格式与上面相同
    oldproxy = []
    plugins['plugins.forold'] = 'oldproxy'
    
    #根据AutoProxy规则生成PAC用于浏览器或者提供判断函数用于find_http_handler,可指定
    #多个网址,如需使用代理,格式为(url, proxy),代理格式与下面rawproxy中设置相同
    autoproxy = {}
    autoproxy['PROXY 127.0.0.1:8086'] =(
    'http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt',
    'file://userlist.ini'
    )
    autoproxy = autoproxy, 'proxy.pac' #如果指定文件名则生成PAC,否则提供函数
    #plugins['plugins.autoproxy'] = 'autoproxy'
    
    #与以前的DIRECT_PROXY类似,支持http、https、socks4、socks5,设置格式形如
    #'http://127.0.0.1:8086'或者多个级联,如('socks5://1.1.1.1:1','http://2.2.2.2:2')
    rawproxy = (None,)
    plugins['plugins.rawproxy'] = 'rawproxy'
    
    #用伪造证书来代理https
    fakehttps = ''
    plugins['plugins.fakehttps'] = 'fakehttps'
    
    #http(包括用fakehttps转来的https)代理选择函数
    # Note: url is not a string: for 'http://localhost:8086/index.html?arg=1'
    #       you can use url.scheme, url.hostname, url.port, url.path, url.query
    #       to get what you want, if you need the whole url, use url.geturl()
    #       if you want to get ip of the hostname, use url.ip you will get a
    #       pair like (['127.0.0.1'], ['::1'])
    #   >>> URL('http://localhost:8086/index.html?arg=1')
    #   URL(scheme='http', hostname='localhost', port=8086, username=None, 
    #   password=None, path='/index.html', params='', query='arg=1', fragment='')
    def find_http_handler(method, url, headers):
        if method not in ('GET', 'HEAD', 'PUT', 'POST', 'DELETE'):
            return rawproxy[0]
        if method=='DELETE' or int(headers.get('content-length', 0))>0x100000:
            return rawproxy[0]
        if 80<=url.port<=90 or 440<=url.port<=450 or url.port>=1024:
            return gaeproxy
        return rawproxy[0]
    
    #本地服务端支持http、https、socks4、socks5,但需要相应的处理插件来实现
    # reqtype: https/socks4/socks5
    # ip, port, cmd are same to args of check_client for socks4/socks5
    def find_sock_handler(reqtype, ip, port, cmd):
        if reqtype == 'https': return fakehttps
        return rawproxy[0]
    
    #验证用户有效性,如果仅供个人使用,return True即可
    # ip: client ip
    # reqtype: http/https/socks4/socks5
    # args: (method, url, headers) for http
    # args: (host, port, headers) for https
    # args: (cmd, ip, port, userid) for socks4
    # args: (cmd, ip, port, username, password) for socks5
    # please return True if client user is valid else False
    def check_client(ip, reqtype, args):
        return True
  3. 设置多个app样例如下:
  4. gaeproxy = [{
        'url': 'http://id1.appspot.com/fetch.php',
        'key': '',
        'crypto':'AES-CBC-32',
        'proxy':'http://www.google.cn'
    },
    {'url': 'http://id2.appspot.com/fetch.php','key':'123'},
    {'url': 'http://id3.appspot.com/fetch.php',},
    {'url': 'http://id4.appspot.com/fetch.php',},
    {'url': 'http://id5.appspot.com/fetch.php',},
    {'url': 'http://id6.appspot.com/fetch.php',}
    ]
  5. 配置文档有很多函数接口,可以根据python26/27语法进行编写,也可以保留默认设置.
  6. 配置文件完全遵循python26/27语法.可以参考python对应文档

plugins使用说明

一个plugins就是一个软件功能,以hosts为例:

使用hosts功能

plugins['plugins.hosts'] = 'hosts'

不使用hosts功能

#plugins['plugins.hosts'] = 'hosts'
  1. hosts:将一个域名与另一个域名或ip绑定,解决DNS污染或ip屏蔽的问题,如:
  2. hosts = {'.appspot.com':'www.google.cn'}

    即将域名*.appspot.comwww.google.cn绑定,软件会向DNS解析出www.google.cn的ip地址A,然后访问域名*.appspot.com时,会直接连接ip地址A,而不会向DNS解析*.appspot.com的ip

  3. gaeproxy:使用GAE服务器端进行代理(目前的主要功能)
  4. oldproxy:使用GAE0.4.0服务器端或者PHP服务器端进行代理
  5. autoproxy:对访问的URL进行解析以判断直接连接还是使用GAE代理连接
  6. rawproxy:使用其他代理进行连接,如http、https、socks4、socks5
  7. fakehttps:伪造https证书以访问https网站,该功能需要将伪造证书ca.crt放入浏览器信任列表

不满足wallproxy的需求

关于操作系统

  • 由于作者只有windowsXP和Ubuntu(linux)系统,无法开发其他操作系统版本.这里只能抱歉了,
  • 如果你有解决方法,请在issues里面告诉我们.

下面是其他人提出的解决办法(未验证)

  1. android: http://gaeproxy.googlecode.com

关于手机的问题(不成功,没有手机)

  • 过几天再试一下.
  • 在网上看到”淘宝某店可以帮你接收验证码”(未验证)

关于网站(网址)无法连接

  • 无法连接code.google.com、appengine.google.com、www.google.com/accounts/

->请使用其他免费代理,如http、https、socks4、socks5

  • 无法连接http://shell.appspot.com/
    1. 修改代理地址为https://you-id.appspot.com/fetch.php
    2. 设置(需使用http://you-id.appspot.com/fetch.php)
    3. hosts = {'.appspot.com':'www.google.cn'}
      plugins['plugins.hosts'] = 'hosts'

其他声明

  1. 数据保密性不能保证,加密部分只是为了通过其他防火墙或代理的过滤,和防止你的GAE代理被滥用.
  2. 隐匿身份不能保证.
  3. 已知:1.http方式访问GAE会在你机器到GAE传输过程中明文出现你的app-id.
         2.在GAE到对方网站的传输过程中明文出现你的app-id
         3.你访问的网站也会得到你的app-id(包含在UA中)
         4.加密只是简单的将数据对称加密,很容易通过查看你计算机上的配置文件得到密码

来源:http://code.google.com/p/wallproxy/wiki/setupV1
项目地址:http://code.google.com/p/wallproxy/
下载地址:http://code.google.com/p/wallproxy/downloads/list

  1. 流云雨蝶
    2011年3月22日01:33

    按照你的方法设置多apps总是错误?

    • iGFW
      2011年3月22日12:53

      你看看版本对不对,这个是官方的教程不是我写的!