diff --git a/docs/src/content/addons-scripting.md b/docs/src/content/addons-scripting.md index e31d291a9..4e9916ca8 100644 --- a/docs/src/content/addons-scripting.md +++ b/docs/src/content/addons-scripting.md @@ -14,4 +14,19 @@ 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 +{{< example src="examples/addons/scripting-headers.py" lang="py" >}} + + +Here's another example that intercepts requests to a particular URL and sends +an arbitrary response instead: + +{{< example src="examples/simple/send_reply_from_proxy.py" lang="py" >}} + + +You can look at the [http][] module, or the [Request][], and +[Response][] classes for other attributes that you can use when +scripting. + +[http][]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/http.py +[Request]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/net/http/request.py +[Response]: https://github.com/mitmproxy/mitmproxy/blob/master/mitmproxy/net/http/response.py diff --git a/examples/addons/scripting.py b/examples/addons/scripting-headers.py similarity index 100% rename from examples/addons/scripting.py rename to examples/addons/scripting-headers.py