diff options
author | Jake Drahos <drahos.jake@gmail.com> | 2015-06-11 10:27:48 -0500 |
---|---|---|
committer | Jake Drahos <drahos.jake@gmail.com> | 2015-06-11 10:27:48 -0500 |
commit | 8b998cfbeace0777293f3cef804c1bf239758273 (patch) | |
tree | 58d18756e5de9f6f74a3fd2fd352f3ef601f7f67 /libmproxy/console | |
parent | d389b9c59d7f4a4918a15b5a40d771ccc154d751 (diff) | |
download | mitmproxy-8b998cfbeace0777293f3cef804c1bf239758273.tar.gz mitmproxy-8b998cfbeace0777293f3cef804c1bf239758273.tar.bz2 mitmproxy-8b998cfbeace0777293f3cef804c1bf239758273.zip |
Implemented basic marking of flows
- Press m to toggle flow mark
- Flow mark is set in libmproxy/console/common.py. Currently set to "==="
Diffstat (limited to 'libmproxy/console')
-rw-r--r-- | libmproxy/console/common.py | 7 | ||||
-rw-r--r-- | libmproxy/console/flowlist.py | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/libmproxy/console/common.py b/libmproxy/console/common.py index e5bebf7f..584b7475 100644 --- a/libmproxy/console/common.py +++ b/libmproxy/console/common.py @@ -115,6 +115,7 @@ def fcol(s, attr): if urwid.util.detected_encoding: SYMBOL_REPLAY = u"\u21ba" SYMBOL_RETURN = u"\u2190" + SYMBOL_MARK = "===" else: SYMBOL_REPLAY = u"[r]" SYMBOL_RETURN = u"<-" @@ -133,6 +134,10 @@ def raw_format_flow(f, focus, extended, padding): ) else: req.append(fcol(">>" if focus else " ", "focus")) + + if f["marked"]: + req.append(fcol(SYMBOL_MARK, "mark")) + if f["req_is_replay"]: req.append(fcol(SYMBOL_REPLAY, "replay")) req.append(fcol(f["req_method"], "method")) @@ -384,6 +389,8 @@ def format_flow(f, focus, extended=False, hostheader=False, padding=2): err_msg = f.error.msg if f.error else None, resp_code = f.response.code if f.response else None, + + marked = f.marked, ) if f.response: if f.response.content: diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index 39245984..8bb6f87a 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -17,6 +17,7 @@ def _mkhelp(): ("F", "toggle follow flow list"), ("l", "set limit filter pattern"), ("L", "load saved flows"), + ("m", "toggle flow mark"), ("n", "create a new request"), ("P", "copy flow to clipboard"), ("r", "replay request"), @@ -177,6 +178,13 @@ class ConnectionItem(urwid.WidgetWrap): elif key == "D": f = self.master.duplicate_flow(self.flow) self.master.view_flow(f) + elif key == "m": + self.flow.toggle_mark() + signals.flowlist_change.send(self) + if self.flow.marked: + signals.status_message.send(message="Flow is now marked") + else: + signals.status_message.send(message="Flow is now not marked") elif key == "r": r = self.master.replay_request(self.flow) if r: |