Add the --host option, which uses the value in the Host header for dispaly URLs.

- Can be toggled with "o" then "h" in mitmproxy
- Useful for transparent mode
This commit is contained in:
Aldo Cortesi
2013-03-17 17:31:35 +13:00
parent 790ad468e4
commit 0e993bec6f
9 changed files with 56 additions and 8 deletions

View File

@@ -177,7 +177,7 @@ class FlowCache:
flowcache = FlowCache()
def format_flow(f, focus, extended=False, padding=2):
def format_flow(f, focus, extended=False, hostheader=False, padding=2):
d = dict(
intercepting = f.intercepting,
@@ -185,7 +185,7 @@ def format_flow(f, focus, extended=False, padding=2):
req_is_replay = f.request.is_replay(),
req_method = f.request.method,
req_acked = f.request.reply.acked,
req_url = f.request.get_url(),
req_url = f.request.get_url(hostheader=hostheader),
err_msg = f.error.msg if f.error else None,
resp_code = f.response.code if f.response else None,