aboutsummaryrefslogtreecommitdiffstats
path: root/examples/stub.py
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-02-15 23:00:11 +0100
committerMaximilian Hils <git@maximilianhils.com>2016-02-15 23:00:11 +0100
commit87d9afcf2e257eee7c5aa08c3f0dc64da79b0647 (patch)
tree71b10729d160f0269d02548d1ef9e183be1397d9 /examples/stub.py
parent36f34f701991b5d474c005ec45e3b66e20f326a8 (diff)
parent3d9a5157e77b5a3237dc62994f4e3d4c75c2066e (diff)
downloadmitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.tar.gz
mitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.tar.bz2
mitmproxy-87d9afcf2e257eee7c5aa08c3f0dc64da79b0647.zip
Merge pull request #937 from mhils/single-repo
Combine mitmproxy, pathod and netlib in a single repo.
Diffstat (limited to 'examples/stub.py')
-rw-r--r--examples/stub.py79
1 files changed, 0 insertions, 79 deletions
diff --git a/examples/stub.py b/examples/stub.py
deleted file mode 100644
index 516b71a5..00000000
--- a/examples/stub.py
+++ /dev/null
@@ -1,79 +0,0 @@
-"""
- This is a script stub, with definitions for all events.
-"""
-
-
-def start(context, argv):
- """
- Called once on script startup, before any other events.
- """
- context.log("start")
-
-
-def clientconnect(context, root_layer):
- """
- Called when a client initiates a connection to the proxy. Note that a
- connection can correspond to multiple HTTP requests
- """
- context.log("clientconnect")
-
-
-def request(context, flow):
- """
- Called when a client request has been received.
- """
- context.log("request")
-
-
-def serverconnect(context, server_conn):
- """
- Called when the proxy initiates a connection to the target server. Note that a
- connection can correspond to multiple HTTP requests
- """
- context.log("serverconnect")
-
-
-def responseheaders(context, flow):
- """
- Called when the response headers for a server response have been received,
- but the response body has not been processed yet. Can be used to tell mitmproxy
- to stream the response.
- """
- context.log("responseheaders")
-
-
-def response(context, flow):
- """
- Called when a server response has been received.
- """
- context.log("response")
-
-
-def error(context, flow):
- """
- Called when a flow error has occured, e.g. invalid server responses, or
- interrupted connections. This is distinct from a valid server HTTP error
- response, which is simply a response with an HTTP error code.
- """
- context.log("error")
-
-
-def serverdisconnect(context, server_conn):
- """
- Called when the proxy closes the connection to the target server.
- """
- context.log("serverdisconnect")
-
-
-def clientdisconnect(context, root_layer):
- """
- Called when a client disconnects from the proxy.
- """
- context.log("clientdisconnect")
-
-
-def done(context):
- """
- Called once on script shutdown, after any other events.
- """
- context.log("done")