Skip to content

Instantly share code, notes, and snippets.

@ShaneIsley
Created May 11, 2011 03:48
Show Gist options
  • Save ShaneIsley/965891 to your computer and use it in GitHub Desktop.
Save ShaneIsley/965891 to your computer and use it in GitHub Desktop.
urwid & mitmproxy install on OSX http://pastebin.com/rAd9Bt7E
$ workon pen
$ git clone git://github.com/wardi/urwid.git
$ cd urwid
$ gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c source/str_util.c -o build/temp.macosx-10.6-universal-2.6/source/str_util.o
$ python setup.py build
$ python setup.py install
$ git clone https://github.com/cortesi/mitmproxy.git
$ cd mitmproxy
# source/libmproxy/console.py を修正
diff --git a/libmproxy/console.py b/libmproxy/console.py
index 399640c..d655e53 100644
--- a/libmproxy/console.py
+++ b/libmproxy/console.py
@@ -117,7 +117,7 @@ def int_version(v):
v = urwid.__version__.split(".")
x = 0
for i in range(min(SIG, len(v))):
- x += int(v[i]) * 10**(SIG-i)
+ x += int(v[i].split('-')[0]) * 10**(SIG-i)
return x
$ python setup.py build
$ python setup.py install
$ mitmproxy --help
Usage: mitmproxy [options] [flowdump path]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-a ADDR Address to bind proxy to (defaults to all interfaces)
--confdir=CONFDIR Configuration directory. (~/.mitmproxy)
-p PORT Proxy service port.
-q Quiet.
--anticache Strip out request headers that might cause the server
to return 304-not-modified.
--reqscript=REQUEST_SCRIPT
Script to run when a request is recieved.
--respscript=RESPONSE_SCRIPT
Script to run when a response is recieved.
-t Set sticky cookie for all requests.
-T FILTER Set sticky cookie filter. Matched against requests.
-u Set sticky auth for all requests.
-U FILTER Set sticky auth filter. Matched against requests.
-v Increase verbosity. Can be passed multiple times.
-w WFILE Write flows to file.
--debug
Client Replay:
-c PATH Replay client requests from a saved file.
Server Replay:
-s PATH Replay server responses from a saved file.
-k Kill extra requests during replay.
--rheader=RHEADERS Request headers to be considered during replay. Can be
passed multiple times.
--norefresh Disable response refresh, which updates times in
cookies and headers for replayed responses.
SSL:
--cert=CERT User-created SSL certificate file.
--ciphers=CIPHERS SSL ciphers.
Filters:
See help in mitmproxy for filter expression syntax.
-l LIMIT, --limit=LIMIT
Limit filter expression.
-i INTERCEPT, --intercept=INTERCEPT
Intercept filter expression.
$ mitmdump --help
Usage: mitmdump [options] [filter]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
-a ADDR Address to bind proxy to (defaults to all interfaces)
--confdir=CONFDIR Configuration directory. (~/.mitmproxy)
-p PORT Proxy service port.
-q Quiet.
--anticache Strip out request headers that might cause the server
to return 304-not-modified.
--reqscript=REQUEST_SCRIPT
Script to run when a request is recieved.
--respscript=RESPONSE_SCRIPT
Script to run when a response is recieved.
-t Set sticky cookie for all requests.
-T FILTER Set sticky cookie filter. Matched against requests.
-u Set sticky auth for all requests.
-U FILTER Set sticky auth filter. Matched against requests.
-v Increase verbosity. Can be passed multiple times.
-w WFILE Write flows to file.
--keepserving Continue serving after playback. We exit by default.
Client Replay:
-c PATH Replay client requests from a saved file.
Server Replay:
-s PATH Replay server responses from a saved file.
-k Kill extra requests during replay.
--rheader=RHEADERS Request headers to be considered during replay. Can be
passed multiple times.
--norefresh Disable response refresh, which updates times in
cookies and headers for replayed responses.
SSL:
--cert=CERT User-created SSL certificate file.
--ciphers=CIPHERS SSL ciphers.
@niko
Copy link

niko commented Feb 8, 2012

This worked for me (OSX 10.7.3, system python 2.7.1):

sudo env ARCHFLAGS="-arch i386" easy_install http://excess.org/urwid/urwid-1.0.1.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment