mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 16:17:49 +00:00
b94f5fd361
Remove the test that just loads all the example scripts for now - it's a very low-value test, and we need to think of something better.
23 lines
427 B
Python
23 lines
427 B
Python
import random
|
|
import sys
|
|
|
|
from mitmproxy.flow import FlowWriter
|
|
|
|
state = {}
|
|
|
|
|
|
def configure(options):
|
|
if len(sys.argv) != 2:
|
|
raise ValueError('Usage: -s "flowriter.py filename"')
|
|
|
|
if sys.argv[1] == "-":
|
|
f = sys.stdout
|
|
else:
|
|
f = open(sys.argv[1], "wb")
|
|
state["flow_writer"] = FlowWriter(f)
|
|
|
|
|
|
def response(flow):
|
|
if random.choice([True, False]):
|
|
state["flow_writer"].add(flow)
|