From 8866cc31bde3b7aa3dc1aa57b016be73694e241a Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Thu, 12 Aug 2021 10:18:56 +0200 Subject: [PATCH] view: add id-based flow selection --- mitmproxy/addons/view.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mitmproxy/addons/view.py b/mitmproxy/addons/view.py index 4c3037ce8..b0479a50a 100644 --- a/mitmproxy/addons/view.py +++ b/mitmproxy/addons/view.py @@ -9,6 +9,7 @@ The View: removed from the store. """ import collections +import re import typing import blinker @@ -449,6 +450,9 @@ class View(collections.abc.Sequence): return [i for i in self._store.values() if i.marked] elif flow_spec == "@unmarked": return [i for i in self._store.values() if not i.marked] + elif re.match(r"@[0-9a-f\-,]{36,}", flow_spec): + ids = flow_spec[1:].split(",") + return [i for i in self._store.values() if i.id in ids] else: filt = flowfilter.parse(flow_spec) if not filt: