Documentation, setup.py updates, styling.

This commit is contained in:
Aldo Cortesi 2013-01-02 14:02:41 +13:00
parent e93b343ac4
commit 7b3d3dc85e
11 changed files with 62 additions and 53 deletions

View File

@ -3,3 +3,7 @@
font-size: 1em;
background: #000000;
}
pre {
color: #333;
}

View File

@ -24,14 +24,16 @@
$!nav("faq.html", this, state)!$
<li class="nav-header">Features</li>
$!nav("anticache.html", this, state)!$
$!nav("clientreplay.html", this, state)!$
$!nav("filters.html", this, state)!$
$!nav("proxyauth.html", this, state)!$
$!nav("replacements.html", this, state)!$
$!nav("serverreplay.html", this, state)!$
$!nav("setheaders.html", this, state)!$
$!nav("sticky.html", this, state)!$
$!nav("reverseproxy.html", this, state)!$
$!nav("upstreamcerts.html", this, state)!$
$!nav("replacements.html", this, state)!$
$!nav("anticache.html", this, state)!$
$!nav("filters.html", this, state)!$
<li class="nav-header">SSL interception</li>
$!nav("ssl.html", this, state)!$
@ -58,7 +60,9 @@
</div>
<div class="span9">
<div class="page-header">
<h1>@!this.title!@</h1>
</div>
$!body!$
</div>

View File

@ -5,6 +5,6 @@
When the __anticache__ option is passed to mitmproxy, it removes headers
(__if-none-match__ and __if-modified-since__) that might elicit a
304-not-modified response from the server. This is useful when you want to make
sure you capture an HTTP exchange in its totality, and during [client
replay](@!urlTo("clientreplay.html")!@).
sure you capture an HTTP exchange in its totality. It's also often used during
[client replay](@!urlTo("clientreplay.html")!@), when you want to make sure the
server responds with complete data.

View File

@ -9,6 +9,5 @@ before starting the next request. This might differ from the recorded
conversation, where requests may have been made concurrently.
You may want to use client-side replay in conjunction with the
[anticache](@!urlTo("anticache.html")!@) option.
[anticache](@!urlTo("anticache.html")!@) option, to make sure the server
responds with complete data.

View File

@ -2,13 +2,15 @@
Many commands in __mitmproxy__ and __mitmdump__ take a filter expression.
Filter expressions consist of the following operators:
<table>
<table class="table">
<tbody>
<!--(for i in filt_help)-->
<tr>
<td class="filt_cmd">@!i[0]!@</td>
<td class="filt_help">@!i[1]!@</td>
</tr>
<!--(end)-->
</tbody>
</table>
- Regexes are Python-style

View File

@ -65,16 +65,20 @@ pages = [
Page("install.html", "Installation"),
Page("mitmproxy.html", "mitmproxy"),
Page("mitmdump.html", "mitmdump"),
Page("anticache.html", "Anticache"),
Page("clientreplay.html", "Client-side replay"),
Page("filters.html", "Filter expressions"),
Page("setheaders.html", "Set Headers"),
Page("serverreplay.html", "Server-side replay"),
Page("sticky.html", "Sticky cookies and auth"),
Page("upstreamcerts.html", "Upstream Certs"),
Page("proxyauth.html", "Proxy Authentication"),
Page("replacements.html", "Replacements"),
Page("reverseproxy.html", "Reverse proxy mode"),
Page("anticache.html", "Anticache"),
Page("filters.html", "Filter expressions"),
Page("ssl.html", "SSL Overview"),
Page("transparent.html", "Transparent Overview"),
Page("upstreamcerts.html", "Upstream Certs"),
Page("ssl.html", "Overview"),
Page("transparent.html", "Overview"),
Directory("certinstall"),
Directory("scripting"),
Directory("tutorials"),

View File

@ -1,54 +1,49 @@
## Using Pip
The preferred way to install mitmproxy - whether you're installing the latest
release or from source - is to use [pip](http://www.pip-installer.org/). If you
don't already have pip on your system, you can find installation instructions
[here](http://www.pip-installer.org/en/latest/installing.html).
The preferred way to install mitmproxy is to use
[pip](http://pypi.python.org/pypi/pip). A single command will install the
latest release of mitmproxy, along with all its dependencies:
<pre>
sudo pip install mitmproxy
## Installing the latest release
A single command will download and install the latest release of mitmproxy,
along with all its dependencies:
<pre class="terminal">
pip install mitmproxy
</pre>
## From Source
## Installing from source
- When installing from source, you will need to install the
[dependencies](@!urlTo("index.html")!@) by hand.
- Then run the following command from the base of the source distribution:
When installing from source, the easiest method is still to use pip. In this
case run:
<pre>
sudo python setup.py install
<pre class="terminal">
pip install /path/to/source
</pre>
Note that if you're installing current git master, you will also have to
install the current git master of [netlib](http://github.com/cortesi/netlib) by
hand.
## OSX
- If you're running a Python interpreter installed with homebrew (or similar),
you may have to install some dependencies by hand.
- Make sure that XCode is installed from the App Store, and that the
command-line tools have been downloaded (XCode/Preferences/Downloads).
- Install __pip__ using the following command:
<pre>
sudo easy_install pip
</pre>
- Now use __pip__ to set up the dependencies and do the install:
<pre>
sudo pip install mitmproxy
</pre>
This procedure may vary if, for instance, you've installed Python from an
external source like [homebrew](http://mxcl.github.com/homebrew/). In that
case, the easiest way to proceed is to first install __easy_install__, then
continue as above.
- Now use __pip__ to do the installation, as above.
There are a few bits of customization you might want to do to make mitmproxy
comfortable to use. At the moment, mitmproxy's color scheme is optimized for a
dark background terminal, so you probably want to change the default. You can
use the OSX <b>open</b> program to create a simple and effective
<b>~/.mailcap</b> file to view HTTP bodies:
comfortable to use on OSX. The default color scheme is optimized for a dark
background terminal, but you can select a palette for a light terminal
background with the --palette option. You can use the OSX <b>open</b> program
to create a simple and effective <b>~/.mailcap</b> file to view request and
response bodies:
<pre>
<pre class="terminal">
application/*; /usr/bin/open -Wn %s
audio/*; /usr/bin/open -Wn %s
image/*; /usr/bin/open -Wn %s

2
doc-src/proxyauth.html Normal file
View File

@ -0,0 +1,2 @@
Proxy auth.

2
doc-src/setheaders.html Normal file
View File

@ -0,0 +1,2 @@
Setheaders.

View File

@ -12,7 +12,7 @@ class NullProxyAuth():
def clean(self, headers):
"""
Clean up authentication headers, so they're not passed upstream.
"""
"""
pass
def authenticate(self, headers):
@ -33,7 +33,7 @@ class BasicProxyAuth(NullProxyAuth):
AUTH_HEADER = 'Proxy-Authorization'
def __init__(self, password_manager, realm):
NullProxyAuth.__init__(self, password_manager)
self.realm = realm
self.realm = realm
def clean(self, headers):
del headers[self.AUTH_HEADER]

View File

@ -93,7 +93,4 @@ setup(
"Topic :: Software Development :: Testing"
],
install_requires=["netlib", "urwid>=1.1", "pyasn1>0.1.2", "pyopenssl>=0.12", "PIL", "lxml"],
dependency_links=[
'https://github.com/cortesi/netlib/tarball/master#egg=netlib-0.1'
],
)