diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2012-04-24 14:58:18 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2012-04-24 14:58:18 +1200 |
commit | efa98d514c6a8b6670d808f2bddb7158a6741ff0 (patch) | |
tree | 9146c6d9ed5e7f4e00b719818d58c9d1933f1089 /examples/proxapp | |
parent | c8d2b2594bd38d988c387073ac5cfe62cf05122e (diff) | |
download | mitmproxy-efa98d514c6a8b6670d808f2bddb7158a6741ff0.tar.gz mitmproxy-efa98d514c6a8b6670d808f2bddb7158a6741ff0.tar.bz2 mitmproxy-efa98d514c6a8b6670d808f2bddb7158a6741ff0.zip |
Docs and comments for WSGI app example.
Diffstat (limited to 'examples/proxapp')
-rwxr-xr-x | examples/proxapp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/examples/proxapp b/examples/proxapp index cb1fd881..e8179528 100755 --- a/examples/proxapp +++ b/examples/proxapp @@ -1,9 +1,13 @@ #!/usr/bin/env python +""" + This example shows how to graft a WSGI app onto mitmproxy. In this + instance, we're using the Bottle framework (http://bottlepy.org/) to expose + a single simplest-possible page. +""" import bottle import os from libmproxy import proxy, flow - @bottle.route('/') def index(): return 'Hi!' @@ -35,6 +39,8 @@ config = proxy.ProxyConfig( ) state = flow.State() server = proxy.ProxyServer(config, 8080) +# Register the app using the magic domain "proxapp" on port 80. Requests to +# this domain and port combination will now be routed to the WSGI app instance. server.apps.add(bottle.app(), "proxapp", 80) m = MyMaster(server, state) m.run() |