diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/custom_contentviews.py | 2 | ||||
-rw-r--r-- | examples/filt.py | 2 | ||||
-rw-r--r-- | examples/flowwriter.py | 2 | ||||
-rw-r--r-- | examples/har_extractor.py | 2 | ||||
-rw-r--r-- | examples/iframe_injector.py | 2 | ||||
-rw-r--r-- | examples/modify_response_body.py | 2 | ||||
-rw-r--r-- | examples/proxapp.py | 2 | ||||
-rw-r--r-- | examples/stub.py | 9 | ||||
-rw-r--r-- | examples/tls_passthrough.py | 2 |
9 files changed, 17 insertions, 8 deletions
diff --git a/examples/custom_contentviews.py b/examples/custom_contentviews.py index b10d936f..5a63e2a0 100644 --- a/examples/custom_contentviews.py +++ b/examples/custom_contentviews.py @@ -62,7 +62,7 @@ class ViewPigLatin(contentviews.View): pig_view = ViewPigLatin() -def configure(options): +def start(): contentviews.add(pig_view) diff --git a/examples/filt.py b/examples/filt.py index 102d1274..21744edd 100644 --- a/examples/filt.py +++ b/examples/filt.py @@ -6,7 +6,7 @@ from mitmproxy import filt state = {} -def configure(options): +def start(): if len(sys.argv) != 2: raise ValueError("Usage: -s 'filt.py FILTER'") state["filter"] = filt.parse(sys.argv[1]) diff --git a/examples/flowwriter.py b/examples/flowwriter.py index d8fbc1f4..07c7ca20 100644 --- a/examples/flowwriter.py +++ b/examples/flowwriter.py @@ -6,7 +6,7 @@ from mitmproxy.flow import FlowWriter state = {} -def configure(options): +def start(): if len(sys.argv) != 2: raise ValueError('Usage: -s "flowriter.py filename"') diff --git a/examples/har_extractor.py b/examples/har_extractor.py index 23deb43a..2a69b9af 100644 --- a/examples/har_extractor.py +++ b/examples/har_extractor.py @@ -61,7 +61,7 @@ class Context(object): context = Context() -def configure(options): +def start(): """ On start we create a HARLog instance. You will have to adapt this to suit your actual needs of HAR generation. As it will probably be diff --git a/examples/iframe_injector.py b/examples/iframe_injector.py index 40934dd3..70247d31 100644 --- a/examples/iframe_injector.py +++ b/examples/iframe_injector.py @@ -7,7 +7,7 @@ from mitmproxy.models import decoded iframe_url = None -def configure(options): +def start(): if len(sys.argv) != 2: raise ValueError('Usage: -s "iframe_injector.py url"') global iframe_url diff --git a/examples/modify_response_body.py b/examples/modify_response_body.py index 8b6908a4..23ad0151 100644 --- a/examples/modify_response_body.py +++ b/examples/modify_response_body.py @@ -8,7 +8,7 @@ from mitmproxy.models import decoded state = {} -def configure(options): +def start(): if len(sys.argv) != 3: raise ValueError('Usage: -s "modify_response_body.py old new"') # You may want to use Python's argparse for more sophisticated argument diff --git a/examples/proxapp.py b/examples/proxapp.py index 095f412a..2935b587 100644 --- a/examples/proxapp.py +++ b/examples/proxapp.py @@ -16,7 +16,7 @@ def hello_world(): # Register the app using the magic domain "proxapp" on port 80. Requests to # this domain and port combination will now be routed to the WSGI app instance. -def configure(options): +def start(): mitmproxy.ctx.master.apps.add(app, "proxapp", 80) # SSL works too, but the magic domain needs to be resolvable from the mitmproxy machine due to mitmproxy's design. diff --git a/examples/stub.py b/examples/stub.py index 614acee2..7de4012a 100644 --- a/examples/stub.py +++ b/examples/stub.py @@ -4,6 +4,15 @@ import mitmproxy """ + +def start(): + """ + Called once on script startup before any other events + """ + mitmproxy.ctx.log("start") + + + def configure(options): """ Called once on script startup before any other events, and whenever options changes. diff --git a/examples/tls_passthrough.py b/examples/tls_passthrough.py index 306f55f6..20e8f9be 100644 --- a/examples/tls_passthrough.py +++ b/examples/tls_passthrough.py @@ -113,7 +113,7 @@ class TlsFeedback(TlsLayer): tls_strategy = None -def configure(options): +def start(): global tls_strategy if len(sys.argv) == 2: tls_strategy = ProbabilisticStrategy(float(sys.argv[1])) |