aboutsummaryrefslogtreecommitdiffstats
path: root/examples/stub.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stub.py')
-rw-r--r--examples/stub.py9
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.