mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-01 18:27:18 +00:00
* docs: document addon live-reload + testing pattern Issue #6377 asked for addon development docs covering hot reload and testing. mitmproxy already watches scripts loaded with -s for changes and re-imports them on save (mitmproxy/addons/script.py: Script.watcher and the unconditional Script(s, True) at line 218), but that behavior was undocumented, and there was no canonical example of how to unit-test a custom addon with mitmproxy.test.taddons / mitmproxy.test.tflow. Add a "Developing Addons" section to docs/src/content/addons/overview.md with two subsections: - Live Reloading: explains the file-watcher behavior, including which errors leave the previous version unloaded and which don't. - Testing Addons: a small example that unit-tests the Counter addon from anatomy.py using taddons.context() and tflow.tflow(), plus a pointer to tctx.cycle() and the existing test/mitmproxy/addons/ tests for patterns that need the full event sequence. No code changes. * reduce testing section Testing helpers are currently a bit ugly and not part of the public API, so let's not put them front center in the docs. --------- Co-authored-by: Chris (ChrisJr404) <11917633+ChrisJr404@users.noreply.github.com> Co-authored-by: Maximilian Hils <git@maximilianhils.com> |
||
|---|---|---|
| .. | ||
| bucketassets | ||
| raw | ||
| scripts | ||
| src | ||
| .gitignore | ||
| build.py | ||
| modd.conf | ||
| README.md | ||
| setup.sh | ||
| upload-archive.sh | ||
| upload-stable.sh | ||
Mitmproxy Documentation
This directory houses the mitmproxy documentation available at https://docs.mitmproxy.org/.
Prerequisites
- Install hugo "extended".
- Windows users: Depending on your git settings, you may need to manually create a symlink from
/docs/src/examplesto/examples.
Editing docs locally
- Make sure the mitmproxy Python package is installed and the virtual python environment was activated. See CONTRIBUTING.md for details.
- Run
./docs/build.pyto generate additional documentation source files. - Now you can change your working directory to
./docs/srcand runhugo server -D.