diff options
Diffstat (limited to 'examples/filt.py')
-rw-r--r-- | examples/filt.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/examples/filt.py b/examples/filt.py deleted file mode 100644 index 9ccf9fa1..00000000 --- a/examples/filt.py +++ /dev/null @@ -1,20 +0,0 @@ -# This scripts demonstrates how to use mitmproxy's filter pattern in scripts. -# Usage: mitmdump -s "filt.py FILTER" -import sys -from mitmproxy import filt - - -class Filter: - def __init__(self, spec): - self.filter = filt.parse(spec) - - def response(self, flow): - if flow.match(self.filter): - print("Flow matches filter:") - print(flow) - - -def start(): - if len(sys.argv) != 2: - raise ValueError("Usage: -s 'filt.py FILTER'") - return Filter(sys.argv[1]) |