From 2e4f44a1e7fa2a5e2f9b05366a5ce55c1ebf29ef Mon Sep 17 00:00:00 2001 From: lkcl Date: Wed, 14 Jul 2010 01:03:37 +0100 Subject: [PATCH] add HTTP Proxy Server (to 127.0.0.1 port 60001) --- proxyapp.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 proxyapp.py diff --git a/proxyapp.py b/proxyapp.py new file mode 100644 index 0000000..baf6027 --- /dev/null +++ b/proxyapp.py @@ -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() + -- 2.30.2