add HTTP Proxy Server (to 127.0.0.1 port 60001)
authorlkcl <lkcl@teenymac.(none)>
Wed, 14 Jul 2010 00:03:37 +0000 (01:03 +0100)
committerlkcl <lkcl@teenymac.(none)>
Wed, 14 Jul 2010 00:03:37 +0000 (01:03 +0100)
proxyapp.py [new file with mode: 0644]

diff --git a/proxyapp.py b/proxyapp.py
new file mode 100644 (file)
index 0000000..baf6027
--- /dev/null
@@ -0,0 +1,17 @@
+import multitask
+import httpd
+from ProxyServer import ProxyServerRequestHandler
+from httpd import HTTPServer, App, BaseApp
+
+class MyApp(ProxyServerRequestHandler, BaseApp):
+
+    def __init__(self):
+        BaseApp.__init__(self)
+        ProxyServerRequestHandler.__init__(self)
+
+httpd.set_debug(True)
+agent = HTTPServer()   
+agent.apps = dict({'/test': MyApp, '*': MyApp})
+agent.start()
+multitask.run() 
+