aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/content/addons-events.md
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@corte.si>2018-02-22 20:48:17 +1300
committerGitHub <noreply@github.com>2018-02-22 20:48:17 +1300
commit443409e32bcc28a7f0475d7af42efff03473b72f (patch)
tree9d749a57929a950f0e177a9bf4d6cd7d9a88c16b /docs/src/content/addons-events.md
parent1cacefa104626e4e0df5ffb2aa8b0c6f16b615b2 (diff)
parent982508d30f887b4fe8b2a855792ae1e33f378222 (diff)
downloadmitmproxy-443409e32bcc28a7f0475d7af42efff03473b72f.tar.gz
mitmproxy-443409e32bcc28a7f0475d7af42efff03473b72f.tar.bz2
mitmproxy-443409e32bcc28a7f0475d7af42efff03473b72f.zip
Merge pull request #2890 from mitmproxy/newdocs
All new documentation
Diffstat (limited to 'docs/src/content/addons-events.md')
-rw-r--r--docs/src/content/addons-events.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/docs/src/content/addons-events.md b/docs/src/content/addons-events.md
new file mode 100644
index 00000000..489ea342
--- /dev/null
+++ b/docs/src/content/addons-events.md
@@ -0,0 +1,24 @@
+---
+title: "Events"
+menu:
+ addons:
+ weight: 2
+---
+
+# Events
+
+Addons hook into mitmproxy's internal mechanisms through events. These are
+implemented on addons as methods with a set of well-known names. Many events
+receive `Flow` objects as arguments - by modifying these objects, addons can
+change traffic on the fly. For instance, here is an addon that adds a response
+header with a count of the number of responses seen:
+
+{{< example src="examples/addons/addheader.py" lang="py" >}}
+
+
+## Supported Events
+
+Below is an addon class that implements stubs for all events. We've added
+annotations to illustrate the argument types for the various events.
+
+{{< example src="examples/addons/events.py" lang="py" >}} \ No newline at end of file