-
|
-
- 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.template.yaml b/server/gae/app.template.yaml
new file mode 100644
index 000000000..a889d91e5
--- /dev/null
+++ b/server/gae/app.template.yaml
@@ -0,0 +1,22 @@
+application: goagent
+version: 1
+runtime: python27
+api_version: 1
+threadsafe: true
+
+handlers:
+- url: /_gh/.*
+ script: gae.application
+ secure: optional
+
+- url: /favicon.ico
+ script: gae.application
+ secure: optional
+
+- url: /.*
+ script: legacy.application
+ 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..adcd0a0aa
--- /dev/null
+++ b/server/gae/gae.py
@@ -0,0 +1,264 @@
+#!/usr/bin/env python
+# coding:utf-8
+
+__version__ = '3.2.0'
+__password__ = ''
+__hostsdeny__ = () # __hostsdeny__ = ('.youtube.com', '.youku.com')
+
+import os
+import re
+import time
+import struct
+import zlib
+import base64
+import logging
+import urlparse
+import httplib
+import io
+import string
+
+from google.appengine.api import urlfetch
+from google.appengine.api.taskqueue.taskqueue import MAX_URL_LENGTH
+from google.appengine.runtime import apiproxy_errors
+
+URLFETCH_MAX = 2
+URLFETCH_MAXSIZE = 4*1024*1024
+URLFETCH_DEFLATE_MAXSIZE = 4*1024*1024
+URLFETCH_TIMEOUT = 30
+
+def message_html(title, banner, detail=''):
+ MESSAGE_TEMPLATE = '''
+
+