# mitmproxy_rs

[![autofix.ci: enabled](https://shields.mitmproxy.org/badge/autofix.ci-yes-success?logo=data:image/svg+xml;base64, )](https://autofix.ci)
[![Continuous Integration Status](https://github.com/mitmproxy/mitmproxy_rs/workflows/CI/badge.svg?branch=main)](https://github.com/mitmproxy/mitmproxy_rs/actions?query=branch%3Amain)
[![Latest Version](https://shields.mitmproxy.org/pypi/v/mitmproxy-rs.svg)](https://pypi.python.org/pypi/mitmproxy-wireguard)
[![Supported Python versions](https://shields.mitmproxy.org/pypi/pyversions/mitmproxy.svg)](https://pypi.python.org/pypi/mitmproxy)
![PyPI - Wheel](https://shields.mitmproxy.org/pypi/wheel/mitmproxy-rs)


This repository contains mitmproxy's Rust bits, most notably:

 - WireGuard Mode: The ability to proxy any device that can be configured as a WireGuard client.
 - Local Redirect Mode: The ability to proxy arbitrary macOS or Windows applications by name or pid.


## Contributing

[![Dev Guide](https://shields.mitmproxy.org/badge/docs-CONTRIBUTING.md-blue)](https://github.com/mitmproxy/mitmproxy_rs/blob/main/CONTRIBUTING.md)
[![dev documentation](https://shields.mitmproxy.org/badge/docs-Python%20API-blue.svg)](https://mitmproxy.github.io/mitmproxy_rs/)

### Structure

- [`src/`](./src): The `mitmproxy` crate containing most of the "meat".
- [`mitmproxy-rs/`](./mitmproxy-rs): The `mitmproxy-rs` Python package,
  which provides PyO3 bindings for the Rust crate.  
  Source and binary distributions are available [on PyPI](https://pypi.org/project/mitmproxy-rs/).
- [`mitmproxy-macos/`](./mitmproxy-macos): The `mitmproxy-macos` Python package, which
  contains a macOS Network Extension to transparently intercept macOS traffic.  
  Only a binary distribution is available [on PyPI](https://pypi.org/project/mitmproxy-macos/)
  due to code signing and notarization requirements.
- [`mitmproxy-windows/`](./mitmproxy-windows): The `mitmproxy-windows` Python package, which
  contains the Windows traffic redirector based on WinDivert.  
  Only a binary distribution is available [on PyPI](https://pypi.org/project/mitmproxy-windows/)
  due to build complexity.

### Architecture

![library architecture](architecture.png)
