diff options
author | Ivaylo Popov <popov.ivo@gmail.com> | 2013-05-27 23:09:42 -0400 |
---|---|---|
committer | Ivaylo Popov <popov.ivo@gmail.com> | 2013-05-27 23:09:42 -0400 |
commit | ffeede9b39c8d269766fd56d02eb7e78d8d13bb2 (patch) | |
tree | 31fe56a11080900d712e647ad4a48d392b7e3d68 /libmproxy/platform/pf.py | |
parent | 82cb1dae41d4211832c28f65f45196e8b648ee65 (diff) | |
download | mitmproxy-ffeede9b39c8d269766fd56d02eb7e78d8d13bb2.tar.gz mitmproxy-ffeede9b39c8d269766fd56d02eb7e78d8d13bb2.tar.bz2 mitmproxy-ffeede9b39c8d269766fd56d02eb7e78d8d13bb2.zip |
Use lsof instead of pfctl to find target host on OSX in transparent mode.
Diffstat (limited to 'libmproxy/platform/pf.py')
-rw-r--r-- | libmproxy/platform/pf.py | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/libmproxy/platform/pf.py b/libmproxy/platform/pf.py deleted file mode 100644 index 062d3311..00000000 --- a/libmproxy/platform/pf.py +++ /dev/null @@ -1,16 +0,0 @@ - -def lookup(address, port, s): - """ - Parse the pfctl state output s, to look up the destination host - matching the client (address, port). - - Returns an (address, port) tuple, or None. - """ - spec = "%s:%s"%(address, port) - for i in s.split("\n"): - if "ESTABLISHED:ESTABLISHED" in i and spec in i: - s = i.split() - if len(s) > 4: - s = s[4].split(":") - if len(s) == 2: - return s[0], int(s[1]) |