diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-05-31 01:51:31 +0200 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-05-31 01:51:31 +0200 |
commit | ec92fca8c030fe5971a034a658033f70965b990a (patch) | |
tree | ef9a2049eeab539d13e1f9662fd51220ab4ee817 /examples/stub.py | |
parent | 0f8e8ee1ad667c8d747d5876f9b630ecbc01d7e9 (diff) | |
parent | a05a70d8168a07c92b2a3ecbbb1958d85532efe3 (diff) | |
download | mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.gz mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.tar.bz2 mitmproxy-ec92fca8c030fe5971a034a658033f70965b990a.zip |
Merge branch 'master' of github.com:mitmproxy/mitmproxy
Diffstat (limited to 'examples/stub.py')
-rw-r--r-- | examples/stub.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/stub.py b/examples/stub.py index c5cdad9c..d5502a47 100644 --- a/examples/stub.py +++ b/examples/stub.py @@ -1,12 +1,15 @@ """ 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, conn_handler): """ Called when a client initiates a connection to the proxy. Note that a @@ -14,6 +17,7 @@ def clientconnect(context, conn_handler): """ context.log("clientconnect") + def serverconnect(context, conn_handler): """ Called when the proxy initiates a connection to the target server. Note that a @@ -21,6 +25,7 @@ def serverconnect(context, conn_handler): """ context.log("serverconnect") + def request(context, flow): """ Called when a client request has been received. @@ -36,12 +41,14 @@ def responseheaders(context, flow): """ 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 @@ -50,12 +57,14 @@ def error(context, flow): """ context.log("error") + def clientdisconnect(context, conn_handler): """ Called when a client disconnects from the proxy. """ context.log("clientdisconnect") + def done(context): """ Called once on script shutdown, after any other events. |