mitmproxy/examples
David Kremer e46e064df3 [examples/xss_scanner] replace relative import
test_xss_scanner.py was utterly failing because of a trouble (bug?)
with the `monkeypatch` fixture failing to replace `gethostbyname`
with the correct mock function.

Indeed, when stepping through the code, the `gethostbyname` presumably
mocked was reported as a builtin python function. The problem could
then come from the fact that it is hard to monkeypatch builtin function
in python.

Using absolute imports seems to resolve the problem.
2018-08-15 19:47:55 +02:00
..
addons Rename scripting file 2018-06-08 08:04:53 +02:00
complex [examples/xss_scanner] replace relative import 2018-08-15 19:47:55 +02:00
pathod format examples 2016-05-29 01:23:39 -07:00
simple Fixing Typos 2018-05-13 17:31:20 -05:00
keys.yaml typo 2018-05-27 19:40:26 +03:00
README.md organize examples 2016-11-21 02:28:10 +01:00

Mitmproxy Scripting API

Mitmproxy has a powerful scripting API that allows you to control almost any aspect of traffic being proxied. In fact, much of mitmproxys own core functionality is implemented using the exact same API exposed to scripters (see mitmproxy/addons).

This directory contains some examples of the scripting API. We recommend to start with the ones in simple/.

⚠️ If you are browsing this on GitHub, make sure to select the git tag matching your mitmproxy version.

Some inline scripts may require additional dependencies, which can be installed using pip install mitmproxy[examples].