From 70dff87240bb101ffb886faa6a1f40f87258332f Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Tue, 21 Feb 2012 11:01:39 +1300 Subject: Tweaks for reverse proxy mode - Unify key bindings over connection and connection list view - Add help entry - Unset reverse proxy when a blank value is specified --- libmproxy/console/__init__.py | 11 +++++++---- libmproxy/console/connlist.py | 4 ++-- libmproxy/console/help.py | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'libmproxy') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index 38d9223a..2130e59f 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -666,10 +666,13 @@ class ConsoleMaster(flow.FlowMaster): return self.state.set_intercept(txt) def set_reverse_proxy(self, txt): - s = utils.parse_proxy_spec(txt) - if not s: - return "Invalid reverse proxy specification" - self.server.config.reverse_proxy = s + if not txt: + self.server.config.reverse_proxy = None + else: + s = utils.parse_proxy_spec(txt) + if not s: + return "Invalid reverse proxy specification" + self.server.config.reverse_proxy = s def changeview(self, v): if v == "r": diff --git a/libmproxy/console/connlist.py b/libmproxy/console/connlist.py index f5af2ca2..6504573a 100644 --- a/libmproxy/console/connlist.py +++ b/libmproxy/console/connlist.py @@ -13,7 +13,7 @@ def _mkhelp(): ("l", "set limit filter pattern"), ("L", "load saved flows"), ("r", "replay request"), - ("R", "revert changes to request"), + ("V", "revert changes to request"), ("w", "save all flows matching current limit"), ("W", "save this flow"), ("X", "kill and delete connection, even if it's mid-intercept"), @@ -111,7 +111,7 @@ class ConnectionItem(common.WWrap): if r: self.master.statusbar.message(r) self.master.sync_list_view() - elif key == "R": + elif key == "V": self.state.revert(self.flow) self.master.sync_list_view() elif key == "w": diff --git a/libmproxy/console/help.py b/libmproxy/console/help.py index 367857b8..8b92369c 100644 --- a/libmproxy/console/help.py +++ b/libmproxy/console/help.py @@ -61,6 +61,7 @@ class HelpView(urwid.ListBox): ("q", "quit / return to connection list"), ("Q", "quit without confirm prompt"), + ("R", "set reverse proxy mode"), ("s", "set/unset script"), ("S", "server replay"), ("t", "set sticky cookie expression"), -- cgit v1.2.3