From cd4eea39348fc9d59d4f0cc3f71384f7c1c2b2e2 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 18 Feb 2011 12:40:45 +1300 Subject: First pass of script hooks for mitmdump. Also stub out docs, improve mitmdump error handling. --- doc-src/02-docstyle.css | 2 +- doc-src/index.py | 23 ++++++++++++++++++----- doc-src/library.html | 5 +---- doc-src/mitmdump.html | 0 doc-src/mitmproxy.html | 0 doc-src/scripts.html | 11 +++++++++++ 6 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 doc-src/mitmdump.html create mode 100644 doc-src/mitmproxy.html create mode 100644 doc-src/scripts.html (limited to 'doc-src') diff --git a/doc-src/02-docstyle.css b/doc-src/02-docstyle.css index 236bfc52..dd61d2e8 100644 --- a/doc-src/02-docstyle.css +++ b/doc-src/02-docstyle.css @@ -2,7 +2,7 @@ body { -x-system-font:none; font-family: Helvetica,Arial,Tahoma,Verdana,Sans-Serif; color: #555555; - font-size: 1.3em; + font-size: 1.1em; } a { diff --git a/doc-src/index.py b/doc-src/index.py index 1ff22108..c34fcb78 100644 --- a/doc-src/index.py +++ b/doc-src/index.py @@ -1,7 +1,7 @@ +import os import countershape from countershape import Page, Directory, PythonModule, markup -import countershape.grok - +import countershape.grok, countershape.template this.layout = countershape.Layout("_layout.html") ns.docTitle = "mitmproxy" @@ -16,12 +16,25 @@ ns.sidebar = countershape.widgets.SiblingPageIndex( ) ns.license = file("../LICENSE").read() -ns.index_contents = file("../README").read() -ns.example = file("../examples/stickycookies.py").read() +ns.index_contents = file("../README.mkd").read() + + +top = os.path.abspath(os.getcwd()) +def example(s): + d = file(os.path.join(top, s)).read() + return countershape.template.pySyntax(d) + + +ns.example = example + + pages = [ Page("index.html", "introduction"), - Page("library.html", "library"), + Page("mitmproxy.html", "mitmproxy"), + Page("mitmdump.html", "mitmdump"), + Page("scripts.html", "scripts"), + Page("library.html", "libmproxy"), Page("faq.html", "faq"), Page("admin.html", "administrivia") ] diff --git a/doc-src/library.html b/doc-src/library.html index e8533731..2266c077 100644 --- a/doc-src/library.html +++ b/doc-src/library.html @@ -8,8 +8,5 @@ this lets you log in to a site using your browser, and then make subsequent requests using a tool like __curl__, which will then seem to be part of the authenticated session. - - -$!example!$ - +$!example("../examples/stickycookies.py")!$ diff --git a/doc-src/mitmdump.html b/doc-src/mitmdump.html new file mode 100644 index 00000000..e69de29b diff --git a/doc-src/mitmproxy.html b/doc-src/mitmproxy.html new file mode 100644 index 00000000..e69de29b diff --git a/doc-src/scripts.html b/doc-src/scripts.html new file mode 100644 index 00000000..b7085c79 --- /dev/null +++ b/doc-src/scripts.html @@ -0,0 +1,11 @@ + +Both __mitmproxy__ and __mitmdump__ allow you to modify requests and responses +with external scripts. The script interface is simple - scripts simply read, +modify and return a single __libmproxy.flow.Flow__ object, using the methods +defined in the __libmproxy.script__ module. Scripts must be executable. + +$!example("../examples/simple_script")!$ + + + + -- cgit v1.2.3