aboutsummaryrefslogtreecommitdiffstats
path: root/examples/filt.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/filt.py')
-rw-r--r--examples/filt.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/filt.py b/examples/filt.py
index cce2a48a..d2daf9a2 100644
--- a/examples/filt.py
+++ b/examples/filt.py
@@ -3,12 +3,14 @@
from libmproxy import filt
+
def start(context, argv):
- if len(argv) != 2:
- raise ValueError("Usage: -s 'filt.py FILTER'")
- context.filter = filt.parse(argv[1])
+ if len(argv) != 2:
+ raise ValueError("Usage: -s 'filt.py FILTER'")
+ context.filter = filt.parse(argv[1])
+
def response(context, flow):
- if flow.match(context.filter):
- print("Flow matches filter:")
- print(flow)
+ if flow.match(context.filter):
+ print("Flow matches filter:")
+ print(flow)