To get started hacking on mitmproxy_rs, please install mitmproxy as described in the main mitmproxy repository and install the latest Rust release. Make sure that you have mitmproxy's virtualenv activated and run the following:
pip install maturin
git clone https://github.com/mitmproxy/mitmproxy_rs.git
cd mitmproxy_rs/mitmproxy-rs
maturin develop
mitmproxy now uses your locally-compiled version of mitmproxy_rs
. After applying any changes to the Rust code,
re-run maturin develop
and restart mitmproxy for changes to apply.
If you've followed the procedure above, you can run the basic test suite as follows:
cargo test --workspace
Please ensure that all patches are accompanied by matching changes in the test suite.
The format for Rust code is enforced by cargo fmt
.
Pull requests will be automatically fixed by CI.
The asynchronous runtime can be introspected using tokio-console
if the crate
was built with the tracing
feature:
tokio-console http://localhost:6669
There should be no task that is busy when the program is idle, i.e. there should be no busy waiting.
If you are the current maintainer of mitmproxy_rs, you can perform the following steps to ship a release:
- Make sure that CI is passing without errors.
- Make sure that CHANGELOG.md is up-to-date with all entries in the "Unreleased" section.
- Invoke the release workflow from the GitHub UI: https://github.com/mitmproxy/mitmproxy_rs/actions/workflows/release.yml
- The spawned workflow run will require manual deploy confirmation on GitHub: https://github.com/mitmproxy/mitmproxy/actions