aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc-src/certinstall/android.html7
-rw-r--r--doc-src/transparent/osx.html12
-rw-r--r--libmproxy/console/common.py2
-rw-r--r--libmproxy/proxy.py4
4 files changed, 18 insertions, 7 deletions
diff --git a/doc-src/certinstall/android.html b/doc-src/certinstall/android.html
index e4efec1d..f215d91d 100644
--- a/doc-src/certinstall/android.html
+++ b/doc-src/certinstall/android.html
@@ -1,4 +1,3 @@
-
The proxy situation on Android is [an
embarrasment](http://code.google.com/p/android/issues/detail?id=1273). It's
scarcely credible, but Android didn't have a global proxy setting at all until
@@ -15,12 +14,12 @@ below - your device may differ, but the broad process should be similar.
## Getting the certificate onto the device
First we need to get the __mitmproxy-ca-cert.cer__ file into the
-__/sdcard/Downloads__ folder on the device. There are a number of ways to do
+__/sdcard/Download__ folder on the device. There are a number of ways to do
this. If you have the Android Developer Tools installed, you can use [__adb
push__](http://developer.android.com/tools/help/adb.html) to accomplish this.
Depending on your device, you could also transfer the file using external media
like an SD Card. In this example, we're using wget from within a terminal
-emulator to transfer the certificate from a local HTTP server:
+emulator to transfer the certificate from a local HTTP server:
<img src="android-shellwgetmitmproxyca.png"/>
@@ -33,7 +32,7 @@ and select "Install from storage":
<img src="android-settingssecuritymenu.png"/>
-The certificate in /sdcard/Downloads is automatically located and offered for
+The certificate in /sdcard/Download is automatically located and offered for
installation. Installing the cert will delete the download file from the local
disk:
diff --git a/doc-src/transparent/osx.html b/doc-src/transparent/osx.html
index 77eea63b..205e4c76 100644
--- a/doc-src/transparent/osx.html
+++ b/doc-src/transparent/osx.html
@@ -67,3 +67,15 @@ rdr on en2 inet proto tcp to any port 443 -&gt; 127.0.0.1 port 8080
</ol>
+
+Note that the **rdr** rules in the pf.conf given above only apply to inbound
+traffic. This means that they will NOT redirect traffic coming from the box
+running pf itself. We can't distinguish between an outbound connection from a
+non-mitmproxy app, and an outbound connection from mitmproxy itself - if you
+want to intercept your OSX traffic, you should use an external host to run
+mitmproxy. None the less, pf is flexible to cater for a range of creative
+possibilities, like intercepting traffic emanating from VMs. See the
+**pf.conf** man page for more.
+
+
+
diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py
index 006303a7..951d2c2a 100644
--- a/libmproxy/console/common.py
+++ b/libmproxy/console/common.py
@@ -190,7 +190,7 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2):
delta = f.response.timestamp_end - f.response.timestamp_start
size = len(f.response.content) + f.response.get_header_size()
- rate = utils.pretty_size(size / delta)
+ rate = utils.pretty_size(size / ( delta if delta > 0 else 1 ) )
d.update(dict(
resp_code = f.response.code,
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 94f358bc..c4bcdcb1 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -259,13 +259,13 @@ class ProxyHandler(tcp.BaseHandler):
else:
response = response_reply
self.send_response(response)
- if request and http.request_connection_close(request.httpversion, request.headers):
+ if request and http.connection_close(request.httpversion, request.headers):
return
# We could keep the client connection when the server
# connection needs to go away. However, we want to mimic
# behaviour as closely as possible to the client, so we
# disconnect.
- if http.response_connection_close(response.httpversion, response.headers):
+ if http.connection_close(response.httpversion, response.headers):
return
except (IOError, ProxyError, http.HttpError, tcp.NetLibError), e:
if hasattr(e, "code"):