diff options
author | Clemens <cle1000.cb@gmail.com> | 2016-07-19 12:32:36 +0200 |
---|---|---|
committer | Clemens <cle1000.cb@gmail.com> | 2016-07-19 12:32:36 +0200 |
commit | 698fb11132598a38851383f805dde5ca4d2a046d (patch) | |
tree | 95fc0184735722ccd6e4697f884496d6852e13f6 /examples/filt.py | |
parent | 48728af43ad746d70ef3e251dc28b75028dea1e6 (diff) | |
parent | 18dd84b9081fb5552d5b5b2560405496445e2110 (diff) | |
download | mitmproxy-698fb11132598a38851383f805dde5ca4d2a046d.tar.gz mitmproxy-698fb11132598a38851383f805dde5ca4d2a046d.tar.bz2 mitmproxy-698fb11132598a38851383f805dde5ca4d2a046d.zip |
Merge remote-tracking branch 'origin/master' into flow_editing
Diffstat (limited to 'examples/filt.py')
-rw-r--r-- | examples/filt.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/filt.py b/examples/filt.py index 1a423845..21744edd 100644 --- a/examples/filt.py +++ b/examples/filt.py @@ -3,14 +3,16 @@ import sys from mitmproxy import filt +state = {} -def start(context): + +def start(): if len(sys.argv) != 2: raise ValueError("Usage: -s 'filt.py FILTER'") - context.filter = filt.parse(sys.argv[1]) + state["filter"] = filt.parse(sys.argv[1]) -def response(context, flow): - if flow.match(context.filter): +def response(flow): + if flow.match(state["filter"]): print("Flow matches filter:") print(flow) |