diff options
Diffstat (limited to 'docs/src')
-rw-r--r-- | docs/src/content/addons-scripting.md | 17 | ||||
-rw-r--r-- | docs/src/content/howto-transparent.md | 6 |
2 files changed, 19 insertions, 4 deletions
diff --git a/docs/src/content/addons-scripting.md b/docs/src/content/addons-scripting.md index e31d291a..4e9916ca 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/docs/src/content/howto-transparent.md b/docs/src/content/howto-transparent.md index 07a21ec9..ae36f579 100644 --- a/docs/src/content/howto-transparent.md +++ b/docs/src/content/howto-transparent.md @@ -163,14 +163,14 @@ for earlier versions of OSX. sudo sysctl -w net.inet.ip.forwarding=1 {{< / highlight >}} -### 2. Place the following two lines in a file called, say, **pf.conf**. +### 2. Place the following line in a file called, say, **pf.conf**. {{< highlight none >}} -rdr on en0 inet proto tcp to any port {80, 443} -> 127.0.0.1 port 8080 +rdr pass on en0 inet proto tcp to any port {80, 443} -> 127.0.0.1 port 8080 {{< / highlight >}} -These rules tell pf to redirect all traffic destined for port 80 or 443 +This rule tells pf to redirect all traffic destined for port 80 or 443 to the local mitmproxy instance running on port 8080. You should replace `en0` with the interface on which your test device will appear. |