aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2011-08-27 09:24:04 +1200
committerAldo Cortesi <aldo@nullcube.com>2011-08-27 09:24:04 +1200
commit7629a43d82bb6090ebf9101383603f81f6f9940a (patch)
treeddedf3bd13eb9f624031e8ca42adafce876c6446 /examples
parentb635112d3613d47247ac22390786aaaffcd2a3fd (diff)
downloadmitmproxy-7629a43d82bb6090ebf9101383603f81f6f9940a.tar.gz
mitmproxy-7629a43d82bb6090ebf9101383603f81f6f9940a.tar.bz2
mitmproxy-7629a43d82bb6090ebf9101383603f81f6f9940a.zip
README and minor felicities for script examples.
Diffstat (limited to 'examples')
-rw-r--r--examples/README9
-rw-r--r--examples/upsidedownternet.py3
2 files changed, 6 insertions, 6 deletions
diff --git a/examples/README b/examples/README
index edb70c51..696705a5 100644
--- a/examples/README
+++ b/examples/README
@@ -1,5 +1,6 @@
-
-add_header.py Simple script that just adds a header to every request.
-stub.py Script stub with a method definition for every event.
-stickycookies An example of writing a custom proxy with libmproxy
+add_header.py Simple script that just adds a header to every request.
+flowbasic Basic use of mitmproxy as a library.
+stub.py Script stub with a method definition for every event.
+stickycookies An example of writing a custom proxy with libmproxy.
+upsidedownternet.py Rewrites traffic to turn PNGs upside down.
diff --git a/examples/upsidedownternet.py b/examples/upsidedownternet.py
index 28d34ca9..aaf8ff74 100644
--- a/examples/upsidedownternet.py
+++ b/examples/upsidedownternet.py
@@ -2,8 +2,7 @@ import Image, cStringIO
def response(context, flow):
if flow.response.headers["content-type"] == ["image/png"]:
s = cStringIO.StringIO(flow.response.content)
- img = Image.open(s)
- img = img.rotate(180)
+ img = Image.open(s).rotate(180)
s2 = cStringIO.StringIO()
img.save(s2, "png")
flow.response.content = s2.getvalue()