aboutsummaryrefslogtreecommitdiffstats
path: root/examples/dup_and_replay.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-07-08 20:11:12 -0700
committerGitHub <noreply@github.com>2016-07-08 20:11:12 -0700
commit15c10d49f6b020c5b913ae5b5e8c4b923a507a47 (patch)
treeb13eb4f3ec88fa90b515edcf4323363124dcd995 /examples/dup_and_replay.py
parentf7639e077ab10dc8e7f180f44b531b9ad35c060b (diff)
parent5d2b7c52f9c33e84be5c4330b09b0f2a5ad869e2 (diff)
downloadmitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.gz
mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.tar.bz2
mitmproxy-15c10d49f6b020c5b913ae5b5e8c4b923a507a47.zip
Merge pull request #1327 from mitmproxy/remove-script-context
Remove script context
Diffstat (limited to 'examples/dup_and_replay.py')
-rw-r--r--examples/dup_and_replay.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/dup_and_replay.py b/examples/dup_and_replay.py
index 9ba91d3b..b47bf951 100644
--- a/examples/dup_and_replay.py
+++ b/examples/dup_and_replay.py
@@ -1,4 +1,7 @@
-def request(context, flow):
- f = context.duplicate_flow(flow)
+from mitmproxy import master
+
+
+def request(flow):
+ f = master.duplicate_flow(flow)
f.request.path = "/changed"
- context.replay_request(f)
+ master.replay_request(f, block=True, run_scripthooks=False)