aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/content/addons-scripting.md
diff options
context:
space:
mode:
authorColdFire <9128903+fenilgandhi@users.noreply.github.com>2018-02-23 00:27:10 +0530
committerGitHub <noreply@github.com>2018-02-23 00:27:10 +0530
commit777cb98a86f3e8883383935661e2ed20ed9b6bd4 (patch)
tree67d3e1259dccb83866496f45fe20ac3bd76961ce /docs/src/content/addons-scripting.md
parent6bf250aa3e8ede84d16170d95728c6488444a5a8 (diff)
parent58ccad7576e5fd33e937aba58df2f9edc389e52e (diff)
downloadmitmproxy-777cb98a86f3e8883383935661e2ed20ed9b6bd4.tar.gz
mitmproxy-777cb98a86f3e8883383935661e2ed20ed9b6bd4.tar.bz2
mitmproxy-777cb98a86f3e8883383935661e2ed20ed9b6bd4.zip
Merge branch 'master' into issue-2872
Diffstat (limited to 'docs/src/content/addons-scripting.md')
-rw-r--r--docs/src/content/addons-scripting.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/src/content/addons-scripting.md b/docs/src/content/addons-scripting.md
new file mode 100644
index 00000000..e31d291a
--- /dev/null
+++ b/docs/src/content/addons-scripting.md
@@ -0,0 +1,17 @@
+---
+title: "Scripting"
+menu:
+ addons:
+ weight: 5
+---
+
+# Scripting
+
+Sometimes, we would like to write a quick script without going through the
+trouble of creating a class. The addons mechanism has a shorthand that allows a
+module as a whole to be treated as an addon object. This lets us place event
+handler functions in the module scope. For instance, here is a complete script
+that adds a header to every request.
+
+
+{{< example src="examples/addons/scripting.py" lang="py" >}} \ No newline at end of file