aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console/connview.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-02-08 22:28:15 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-02-08 22:28:15 +1300
commit866a93a8bc28fed47dde04f49c13592a7163bff4 (patch)
treec1620ebf1809a1cdce2771a2399c393d537e12ab /libmproxy/console/connview.py
parente3f28e1c06093147660e2857adce24b441d6530f (diff)
downloadmitmproxy-866a93a8bc28fed47dde04f49c13592a7163bff4.tar.gz
mitmproxy-866a93a8bc28fed47dde04f49c13592a7163bff4.tar.bz2
mitmproxy-866a93a8bc28fed47dde04f49c13592a7163bff4.zip
Start consolidating keybindings.
I want each view to have a more coherent set of bindings. This means minimizing the global bindings, and making some bindings accessible only from screens related to their functionality.
Diffstat (limited to 'libmproxy/console/connview.py')
-rw-r--r--libmproxy/console/connview.py30
1 files changed, 29 insertions, 1 deletions
diff --git a/libmproxy/console/connview.py b/libmproxy/console/connview.py
index f6d24d5e..49418d01 100644
--- a/libmproxy/console/connview.py
+++ b/libmproxy/console/connview.py
@@ -5,13 +5,29 @@ from .. import utils, encoding, flow
def _mkhelp():
text = []
keys = [
+ ("A", "accept all intercepted connections"),
+ ("a", "accept this intercepted connection"),
("b", "save request/response body"),
("e", "edit request/response"),
+ ("m", "change body display mode"),
+ (None,
+ common.highlight_key("raw", "r") +
+ [("text", ": raw data")]
+ ),
+ (None,
+ common.highlight_key("pretty", "p") +
+ [("text", ": pretty-print XML, HTML and JSON")]
+ ),
+ (None,
+ common.highlight_key("hex", "h") +
+ [("text", ": hex dump")]
+ ),
("p", "previous flow"),
("v", "view body in external viewer"),
("z", "encode/decode a request/response"),
("tab", "toggle request/response view"),
("space", "next flow"),
+ ("|", "run script on this flow"),
]
text.extend(common.format_keyvals(keys, key="key", val="text", indent=4))
return text
@@ -433,6 +449,17 @@ class ConnectionView(common.WWrap):
self.edit
)
key = None
+ elif key == "m":
+ self.master.prompt_onekey(
+ "View",
+ (
+ ("raw", "r"),
+ ("pretty", "p"),
+ ("hex", "h"),
+ ),
+ self.master.changeview
+ )
+ key = None
elif key == "p":
self.view_prev_flow(self.flow)
elif key == "r":
@@ -490,7 +517,8 @@ class ConnectionView(common.WWrap):
conn
)
self.master.refresh_connection(self.flow)
- return key
+ else:
+ return key
def encode_callback(self, key, conn):
encoding_map = {