From 75b5c970950f11249353ee10931305cfc1c21400 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Mar 2013 12:18:19 +1300 Subject: Revert "show current filepath in status bar" This reverts commit bf8367d6cf3e6b5b1e916453c9cf114194174a1a. This just doesn't work. We need a better solution, probably in the next release. --- libmproxy/console/__init__.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'libmproxy/console/__init__.py') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index a16cc4dc..4e408012 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -195,9 +195,6 @@ class StatusBar(common.WWrap): if self.master.stream: r.append("[W:%s]"%self.master.stream_path) - if self.master.state.last_saveload: - r.append("[%s]"%self.master.state.last_saveload) - return r def redraw(self): -- cgit v1.2.3 From e608d10f455550b8afd09217f0ecf344a0bdc814 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Mar 2013 12:26:20 +1300 Subject: Remove __slots__ to make it possible to inherit from Options classes. --- libmproxy/console/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmproxy/console/__init__.py') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 4e408012..4b5d1274 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -325,7 +325,7 @@ class ConsoleState(flow.State): class Options(object): - __slots__ = [ + attributes = [ "anticache", "anticomp", "client_replay", @@ -352,7 +352,7 @@ class Options(object): def __init__(self, **kwargs): for k, v in kwargs.items(): setattr(self, k, v) - for i in self.__slots__: + for i in self.attributes: if not hasattr(self, i): setattr(self, i, None) -- cgit v1.2.3 From cfb5ba89ce96594b2f8d51f27c9b2ee41ecf18e5 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Thu, 14 Mar 2013 09:19:43 +1300 Subject: Introduce a filtered flow writer, and use it in dump.py Fixes #104 --- libmproxy/console/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmproxy/console/__init__.py') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 4b5d1274..98904c84 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -426,7 +426,7 @@ class ConsoleMaster(flow.FlowMaster): path = os.path.expanduser(path) try: f = file(path, "wb") - flow.FlowMaster.start_stream(self, f) + flow.FlowMaster.start_stream(self, f, None) except IOError, v: return str(v) self.stream_path = path -- cgit v1.2.3 From 0e993bec6f7fa77e73a08053f4558ff1fc36d022 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 17 Mar 2013 17:31:35 +1300 Subject: 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 --- libmproxy/console/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libmproxy/console/__init__.py') 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": -- cgit v1.2.3