-
|
-
- GoAgent %(version)s on GAE/已经在工作了
- |
-
|
-
- |
- GoAgent是一个开源的HTTP Proxy软件,使用Python编写,运行于Google App Engine平台上.
- |
-
|
-
- |
- 更多相关介绍,请参考GoAgent项目主页.
- |
-
|
-
-
-
- |
-
|
-
-
-
-''' % dict(version=__version__))
-
-def main():
- application = webapp.WSGIApplication([('/_ah/xmpp/message/chat/', MainHandler),('/fetch.py', MainHandler)],debug=True)
- run_wsgi_app(application)
-
-if __name__ == '__main__':
- main()
\ No newline at end of file
diff --git a/server/gae/app.yaml b/server/gae/app.yaml
new file mode 100644
index 000000000..eeeffd3fd
--- /dev/null
+++ b/server/gae/app.yaml
@@ -0,0 +1,30 @@
+application: goagent
+version: 1
+runtime: python27
+api_version: 1
+threadsafe: true
+
+handlers:
+- url: /_gh/.+
+ script: gae.application
+ secure: optional
+
+- url: /2
+ script: gae.application
+ secure: optional
+
+- url: /fetch\.py
+ script: gae.LegacyHandler.application
+ secure: optional
+
+- url: /robots.txt
+ static_files: robots.txt
+ upload: robots.txt
+
+- url: /.*
+ script: gae.mirror
+ secure: optional
+
+libraries:
+- name: pycrypto
+ version: "latest"
diff --git a/server/gae/gae.py b/server/gae/gae.py
new file mode 100644
index 000000000..b2594c01c
--- /dev/null
+++ b/server/gae/gae.py
@@ -0,0 +1,458 @@
+#!/usr/bin/env python
+# coding:utf-8
+
+__version__ = '3.1.5'
+__password__ = ''
+__hostsdeny__ = () # __hostsdeny__ = ('.youtube.com', '.youku.com')
+__content_type__ = 'image/gif'
+__mirror_userjs__ = () # __mirror_userjs__ = '//www.example.com/user.js'
+
+import os
+import re
+import time
+import struct
+import zlib
+import gzip
+import base64
+import logging
+import urlparse
+import io
+import string
+
+from google.appengine.api import urlfetch
+from google.appengine.runtime import apiproxy_errors
+
+URLFETCH_MAX = 2
+URLFETCH_MAXSIZE = 4*1024*1024
+URLFETCH_DEFLATE_MAXSIZE = 4*1024*1024
+URLFETCH_TIMEOUT = 60
+
+def message_html(title, banner, detail=''):
+ MESSAGE_TEMPLATE = '''
+
+