aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/__init__.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-03-17 17:31:35 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-03-17 17:37:54 +1300
commit0e993bec6f7fa77e73a08053f4558ff1fc36d022 (patch)
treea9f0763cf510028c3cd73128dfd0a48991bfedc3 /libmproxy/console/__init__.py
parent790ad468e4352419ef519401680f99ee3beb148d (diff)
downloadmitmproxy-0e993bec6f7fa77e73a08053f4558ff1fc36d022.tar.gz
mitmproxy-0e993bec6f7fa77e73a08053f4558ff1fc36d022.tar.bz2
mitmproxy-0e993bec6f7fa77e73a08053f4558ff1fc36d022.zip
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
Diffstat (limited to 'libmproxy/console/__init__.py')
-rw-r--r--libmproxy/console/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py
index 98904c84..fe75a047 100644
--- a/libmproxy/console/__init__.py
+++ b/libmproxy/console/__init__.py
@@ -174,6 +174,8 @@ class StatusBar(common.WWrap):
opts.append("anticache")
if self.master.anticomp:
opts.append("anticomp")
+ if self.master.showhost:
+ opts.append("showhost")
if not self.master.refresh_server_playback:
opts.append("norefresh")
if self.master.killextra:
@@ -338,6 +340,7 @@ class Options(object):
"refresh_server_playback",
"rfile",
"script",
+ "showhost",
"replacements",
"rheaders",
"setheaders",
@@ -398,6 +401,7 @@ class ConsoleMaster(flow.FlowMaster):
self.killextra = options.kill
self.rheaders = options.rheaders
self.nopop = options.nopop
+ self.showhost = options.showhost
self.eventlog = options.eventlog
self.eventlist = urwid.SimpleListWalker([])
@@ -918,6 +922,7 @@ class ConsoleMaster(flow.FlowMaster):
(
("anticache", "a"),
("anticomp", "c"),
+ ("showhost", "h"),
("killextra", "k"),
("norefresh", "n"),
("no-upstream-certs", "u"),
@@ -957,6 +962,10 @@ class ConsoleMaster(flow.FlowMaster):
self.anticache = not self.anticache
if a == "c":
self.anticomp = not self.anticomp
+ if a == "h":
+ self.showhost = not self.showhost
+ self.sync_list_view()
+ self.refresh_flow(self.currentflow)
elif a == "k":
self.killextra = not self.killextra
elif a == "n":