From a05a70d8168a07c92b2a3ecbbb1958d85532efe3 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sat, 30 May 2015 12:03:28 +1200 Subject: Add coding style check, reformat. --- examples/stub.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'examples/stub.py') 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. -- cgit v1.2.3