@!copyright!@
diff --git a/doc-src/index.html b/doc-src/index.html
index 859ffad07..71e82087a 100644
--- a/doc-src/index.html
+++ b/doc-src/index.html
@@ -1,3 +1,23 @@
-@!index_contents!@
+
+* [Introduction](@!urlTo("intro.html")!@)
+* [mitmproxy](@!urlTo("mitmproxy.html")!@) - Console-based HTTP Swiss Army Knife.
+ * [Tutorial](@!urlTo("mitmproxy/tutorial.html")!@)
+* [mitmdump](@!urlTo("mitmdump.html")!@) - tcpdump for HTTP conversations
+ * [Tutorial](@!urlTo("mitmproxy/tutorial.html")!@)
+* [Client scripts](@!urlTo("scripts.html")!@) - Writing client scripts for mitmproxy and mitmdump
+* [libmproxy](@!urlTo("library.html")!@) - Using the mitmproxy library
+* [SSL](@!urlTo("ssl.html")!@) - Installing mitmproxy's SSL certificate
+ * Browsers:
+ * [Firefox](@!urlTo("ssl.html")!@#firefox)
+ * [Chrome](@!urlTo("ssl.html")!@#chrome)
+ * [Safari](@!urlTo("ssl.html")!@#safari)
+ * [IE8](@!urlTo("ssl.html")!@#ie)
+ * Global installation:
+ * [Windows 7](@!urlTo("ssl.html")!@#windows7)
+ * [iPhone/iPad](@!urlTo("ssl.html")!@#ios)
+* [FAQ](@!urlTo("faq.html")!@)
+* [administrivia](@!urlTo("admin.html")!@)
+
+
diff --git a/doc-src/index.py b/doc-src/index.py
index c34fcb78b..c0546ab12 100644
--- a/doc-src/index.py
+++ b/doc-src/index.py
@@ -8,12 +8,10 @@ ns.docTitle = "mitmproxy"
this.markup = markup.Markdown()
ns.docMaintainer = "Aldo Cortesi"
ns.docMaintainerEmail = "aldo@corte.si"
-ns.copyright = "Aldo Cortesi 2010"
-ns.head = countershape.template.Template(None, "
@!docTitle!@ - @!this.title!@
")
-ns.sidebar = countershape.widgets.SiblingPageIndex(
- '/index.html',
- exclude=['countershape']
- )
+ns.copyright = u"\u00a9 mitmproxy project, 2011"
+ns.title = countershape.template.Template(None, "
@!docTitle!@ - @!this.title!@
")
+
+ns.index = countershape.widgets.SiblingPageIndex('/index.html', divclass="pageindex")
ns.license = file("../LICENSE").read()
ns.index_contents = file("../README.mkd").read()
@@ -30,11 +28,15 @@ ns.example = example
pages = [
- Page("index.html", "introduction"),
+ Page("index.html", "Index"),
+ Page("intro.html", "Introduction"),
Page("mitmproxy.html", "mitmproxy"),
+ Directory("mitmproxy"),
Page("mitmdump.html", "mitmdump"),
- Page("scripts.html", "scripts"),
- Page("library.html", "libmproxy"),
- Page("faq.html", "faq"),
- Page("admin.html", "administrivia")
+ Directory("mitmdump"),
+ Page("scripts.html", "External scripts"),
+ Page("library.html", "libmproxy: mitmproxy as a library"),
+ Page("ssl.html", "SSL"),
+ Page("faq.html", "FAQ"),
+ Page("admin.html", "Administrivia")
]
diff --git a/doc-src/intro.html b/doc-src/intro.html
new file mode 100644
index 000000000..c48206c8e
--- /dev/null
+++ b/doc-src/intro.html
@@ -0,0 +1,2 @@
+
+@!index_contents!@
diff --git a/doc-src/mitmdump/index.py b/doc-src/mitmdump/index.py
new file mode 100644
index 000000000..312ece1db
--- /dev/null
+++ b/doc-src/mitmdump/index.py
@@ -0,0 +1,5 @@
+from countershape import Page, Directory, PythonModule, markup
+
+pages = [
+ Page("tutorial.html", "Tutorial"),
+]
diff --git a/doc-src/mitmdump/tutorial.html b/doc-src/mitmdump/tutorial.html
new file mode 100644
index 000000000..e69de29bb
diff --git a/doc-src/mitmproxy/index.py b/doc-src/mitmproxy/index.py
new file mode 100644
index 000000000..312ece1db
--- /dev/null
+++ b/doc-src/mitmproxy/index.py
@@ -0,0 +1,5 @@
+from countershape import Page, Directory, PythonModule, markup
+
+pages = [
+ Page("tutorial.html", "Tutorial"),
+]
diff --git a/doc-src/mitmproxy/tutorial.html b/doc-src/mitmproxy/tutorial.html
new file mode 100644
index 000000000..e69de29bb
diff --git a/doc-src/screenshots/firefox3-import.jpg b/doc-src/screenshots/firefox3-import.jpg
new file mode 100644
index 000000000..2ccfc490d
Binary files /dev/null and b/doc-src/screenshots/firefox3-import.jpg differ
diff --git a/doc-src/screenshots/firefox3-trust.jpg b/doc-src/screenshots/firefox3-trust.jpg
new file mode 100644
index 000000000..ec780dc33
Binary files /dev/null and b/doc-src/screenshots/firefox3-trust.jpg differ
diff --git a/doc-src/screenshots/firefox3.jpg b/doc-src/screenshots/firefox3.jpg
new file mode 100644
index 000000000..439fb9ad0
Binary files /dev/null and b/doc-src/screenshots/firefox3.jpg differ
diff --git a/doc-src/ssl.html b/doc-src/ssl.html
new file mode 100644
index 000000000..4fe1ee15b
--- /dev/null
+++ b/doc-src/ssl.html
@@ -0,0 +1,41 @@
+
+# Browsers
+
+
+## Firefox 3.x
+
+### 1: Open preferences, click on "Advanced", then select"Encryption":
+
+
![](@!urlTo('firefox3.jpg')!@)
+
+### 2: Click "View Certificates", "Import", and select the certificate file:
+
+
![](@!urlTo('firefox3-import.jpg')!@)
+
+### 3: Tick "Trust this CS to identify web sites", and click "Ok":
+
+
![](@!urlTo('firefox3-trust.jpg')!@)
+
+You should now see the mitmproxy certificate listed in the Authorities tab.
+
+
+
+## Chrome
+
+
+## Safari
+
+
+## Internet Explorer 8
+
+
+# Global installation
+
+
+## Windows 7
+
+
+## iPhone/iPad
+
+
+
diff --git a/libmproxy/console.py b/libmproxy/console.py
index 815eebdf1..fe0326e1a 100644
--- a/libmproxy/console.py
+++ b/libmproxy/console.py
@@ -46,63 +46,58 @@ def format_keyvals(lst, key="key", val="text", space=5, indent=0):
def format_flow(f, focus, extended=False, padding=2):
- if not f.request:
- txt = [
- ("title", " Connection from %s..."%(f.client_conn.address[0])),
- ]
+ if extended:
+ ts = ("highlight", utils.format_timestamp(f.request.timestamp) + " ")
else:
- if extended:
- ts = ("highlight", utils.format_timestamp(f.request.timestamp) + " ")
+ ts = " "
+
+ txt = [
+ ts,
+ ("ack", "!") if f.intercepting and not f.request.acked else " ",
+ ("method", f.request.method),
+ " ",
+ (
+ "text" if (f.response or f.error) else "title",
+ f.request.url(),
+ ),
+ ]
+ if f.response or f.error or f.request.is_replay():
+ tsr = f.response or f.error
+ if extended and tsr:
+ ts = ("highlight", utils.format_timestamp(tsr.timestamp) + " ")
else:
ts = " "
- txt = [
- ts,
- ("ack", "!") if f.intercepting and not f.request.acked else " ",
- ("method", f.request.method),
- " ",
- (
- "text" if (f.response or f.error) else "title",
- f.request.url(),
- ),
- ]
- if f.response or f.error or f.request.is_replay():
- tsr = f.response or f.error
- if extended and tsr:
- ts = ("highlight", utils.format_timestamp(tsr.timestamp) + " ")
- else:
- ts = " "
+ txt.append("\n")
+ txt.append(("text", ts))
+ txt.append(" "*(padding+2))
+ met = ""
+ if f.request.is_replay():
+ txt.append(("method", "[replay] "))
+ elif f.modified():
+ txt.append(("method", "[edited] "))
+ if not (f.response or f.error):
+ txt.append(("text", "waiting for response..."))
- txt.append("\n")
- txt.append(("text", ts))
- txt.append(" "*(padding+2))
- met = ""
- if f.request.is_replay():
- txt.append(("method", "[replay] "))
- elif f.modified():
- txt.append(("method", "[edited] "))
- if not (f.response or f.error):
- txt.append(("text", "waiting for response..."))
-
- if f.response:
- txt.append(
- ("ack", "!") if f.intercepting and not f.response.acked else " "
- )
- txt.append("<- ")
- if f.response.code in [200, 304]:
- txt.append(("goodcode", str(f.response.code)))
- else:
- txt.append(("error", str(f.response.code)))
- t = f.response.headers.get("content-type")
- if t:
- t = t[0].split(";")[0]
- txt.append(("text", " %s"%t))
- if f.response.content:
- txt.append(", %s"%utils.pretty_size(len(f.response.content)))
- elif f.error:
- txt.append(
- ("error", f.error.msg)
- )
+ if f.response:
+ txt.append(
+ ("ack", "!") if f.intercepting and not f.response.acked else " "
+ )
+ txt.append("<- ")
+ if f.response.code in [200, 304]:
+ txt.append(("goodcode", str(f.response.code)))
+ else:
+ txt.append(("error", str(f.response.code)))
+ t = f.response.headers.get("content-type")
+ if t:
+ t = t[0].split(";")[0]
+ txt.append(("text", " %s"%t))
+ if f.response.content:
+ txt.append(", %s"%utils.pretty_size(len(f.response.content)))
+ elif f.error:
+ txt.append(
+ ("error", f.error.msg)
+ )
if focus:
txt.insert(0, ("focus", ">>" + " "*(padding-2)))