mitmproxy/examples/complex/dup_and_replay.py

15 lines
466 B
Python
Raw Normal View History

2016-10-26 05:06:52 +00:00
from mitmproxy import ctx
2016-07-08 01:37:33 +00:00
def request(flow):
# Avoid an infinite loop by not replaying already replayed requests
if flow.request.is_replay:
return
flow = flow.copy()
# Only interactive tools have a view. If we have one, add a duplicate entry
# for our flow.
if "view" in ctx.master.addons:
ctx.master.commands.call("view.add", [flow])
flow.request.path = "/changed"
ctx.master.commands.call("replay.client", [flow])