VisitAppEngineFromChina

2011年7月17日 | 分类: 翻墙相关 | 标签: , ,

说起GAE空间翻墙,以前的GoAgent又一个基于GAE的穿越利器wallproxy-plugins—基于GAE/PHP的 功能更强大、更易于使用、安全性最好 的代理里介绍的GoAgent和wallproxy-plugins的自带上传工具都做了相应修改,虽然AppEngine被墙仍然可以不翻墙直接部署应用,不过apjp不能直接部署AppEngine,所以@twfcc写了VisitAppEngineFromChina的教程。

至于更多关于apjp代理翻墙部署使用的教程可以参考:

http://igfw.net/archives/3594

http://igfw.net/archives/3363

http://igfw.net/archives/3791

前言

APJP個人代理項目發佈了基於Google Application Engine(GAE)平台的服務器版本後,用戶須

通過JAVA SDK上傳所需文件到GAE搭建的應用,然而,在中國大陸訪問appengine.google.com存在

一定的困難,這不單是APJP的問題,其他搭建於GAE的專案項目有著相同的困擾

解決訪問appengine.google.com一些可能的辦法

因為眾所周知的原因,訪問appengine.google.com會可能出現超時(Time Out),重置(Reset)

不能訪問等等現狀,google的443端口受到干擾而非常不穩定,無法正常登錄,更上傳不到所需文件到

部署的應用網址,針對這種情況,發表一些個人的經驗,僅供參考

避免受到DNS污染

DNS污染請參考 http://zh.wikipedia.org/wiki/%E5%9F%9F%E5%90%8D%E6%9C%8D%E5%8B%99%E5%99%A8%E7%B7%A9%E5%AD%98%E6%B1%A1%E6%9F%93

Linux可用iptables暴力解決,例如使用 8.8.8.8 這個DNS,修改/etc/resolv.conf

,寫入nameserver 8.8.8.8 和 nameserver 8.8.4.4 ,在命令列以管理員身份鍵入

iptables -t nat -A PREROUTING -p udp –dport 53 -j DNAT –to-destination 8.8.8.8

這會除了指定的DNS,所有由其他IP通過udp 53端口的通訊都會丟棄,Windows系統沒有iptables,

需要安裝一個名為pydnsproxy, 安裝後可抵抗DNS污染,雖然並不是100%有效,項目地址

http://code.google.com/p/pydnsproxy/

以上對IP封鎖還是沒有辦法,針對IP封鎖,只能使用其他方法

1)使用VPN, VPN是全局代理,這時通過JAVA SDK上傳的文件都會經過遠端服務器上傳下載

2)通過修改hosts文件綁定appengine.google.com,在我的電腦上

ping appengine.google.com 會得到

PING www3.l.google.com (74.125.71.102) 56(84) bytes of data.

64 bytes from hx-in-f102.1e100.net (74.125.71.102): icmp_seq=1 ttl=52 time=4.25 ms

.

.

這樣的訊息,可是這個IP在國內可能訪問不了,google是雲端服務器,其IP Pool數量龐大,通過

修改一個沒有封鎖的google IP就能訪問appengine.google.com, 如何找到可用IP,在Linux

下,有一命令traceroute, windows則有tracert, 在我的Linux下,鍵入

traceroute appengine.google.com ,得到

1 192.168.1.1 (192.168.1.1) 0.796 ms 0.939 ms 0.939 ms

2 .

3 .

9 72.14.196.85 (72.14.196.85) 2.945 ms 2.932 ms 2.970 ms

10 209.85.241.58 (209.85.241.58) 5.351 ms 3.495 ms 209.85.241.56 (209.85.241.56) 3.047 ms

11 216.239.43.19 (216.239.43.19) 4.184 ms 209.85.253.71 (209.85.253.71) 21.076 ms 6.429 ms

12 216.239.48.238 (216.239.48.238) 6.429 ms 216.239.48.230 (216.239.48.230) 6.531 ms

13 hx-in-f102.1e100.net (74.125.71.102) 6.292 ms 6.453 ms 6.494 ms

其中 72.14.196.85 216.239.43.19 216.239.48.238 三個為google IP,如果ping IP

能有反應,以Linux為例,在/etc/hosts 加入

216.239.48.238 appengine.google.com

Windows 請在c:\windows\system32\drivers\etc\hosts 裡加入

使用JAVA SDK上傳APJP_APPENGINE裡文件試試能否成功

3)以appengine-java-sdk-1.5.1為例,其中appcfg.sh或appcfg.cmd有一選項 -p ,在線

幫助提示如是

-p PROXYHOST:PORT, –proxy=PROXYHOST:PORT

Proxies requests through the given proxy server.

If –proxy_https is also set, only HTTP will be

proxied here, otherwise both HTTP and HTTPS will.

如果你有可用的https代理,例如我的Linux有tor和privoxy,而privoxy是本地的http代理,

在appengine-java-sdk-1.5.1/bin/目錄下鍵入

./appcfg.sh -p 127.0.0.1:8118 update war/

也可正常訪問上傳APJP_APPENGINE所需文件

補充

這些方法只供參考,並不能保證一定有效,鑒於中國網絡環境日新月異,上述方法只是我過往在

中國網絡下部署hyk-proxy,gappproxy,javatweet和greproxy的經驗,今天可能已經失效,

如上述方式並不能解決部署APJP_APPENGINE的困擾,請在各大國外BBS,twitter等網站請求幫

APJP项目地址:http://code.google.com/p/apjp/

 

本文原始地址http://igfw.net/archives/3882

  1. AS
    2011年7月20日14:23

    https://code.google.com/p/froxy/
    “Froxy is a proxy which helps user get through the company firewall. Users can config their own blocked web sites in the configuration file and set the proxy server to froxy server. The froxy will help user to fetch these blocked web sites using Google App Engine instead of the way user used before.
    System required:

    Any Operation System
    Java SDK 5 must be installed

    Configuration

    Froxy IP, you have to put IP address of the machine which is running this Froxy here. For example, you can put 10.0.0.24, if you use this machine to start Froxy.
    FroxyPort, the port you want to start the Froxy.
    UseProxy, if the machine can’t access the internet directly, then you can use the original proxy. Here you should put “true” (no quote).
    LocalProxy, the local proxy ip address or machine name.
    ProxyPort, the local proxy port.
    ProxyMask, the blocked web sites which you want to use this Froxy, separated by comma.
    DirectAccess, the website you can directly access, no proxy will be used. For example, you can put your intranet address here.
    DefaultProxy, the default proxy the browser used before we use this new proxy tool. If it was directly connected to the Internet, then use “DIRECT” (no quote). If it is not, the format is PROXY IP:Port. For example, you can put original http proxy “PROXY 10.0.0.21:80” (no quote) here.
    RemoteServer, this is the remote servers the Froxy is going to use. Usually you don’t have to change. But if too many users use the Froxy, you may need to add new servers. I will publish new servers if existing quota is used up.

    Surfing

    After the configuraton, you can start the Froxy.

    In Linux, please use startup.sh.
    In Window, please use startup.bat.

    Put your browser’s automatical proxy setting(firefox) or automatical configration script(IE) as “http://[Froxy IP]:FroxyPort/pac”. Now, the froxy will automatically forward your block websites’ request to app engines. For the other sites, it will use your setting DefaultProxy. Enjoy yourself. ”
    https://code.google.com/p/froxy/downloads/list

    (翻墙相关)

    • iGFW
      2011年7月21日13:45

      感谢支持,一会就发