proxy.py is a lightweight Python toolkit for forward and reverse proxying, TLS interception, DNS-over-HTTPS, embedded web servers, pub/sub, and a Grout feature for exposing local services.
Overview
proxy.py combines a fast, threadless proxy server with optional web server, reverse proxy, and pub/sub capabilities. Everything is implemented as plugins you can enable from the command line or embed in Python code.
It supports HTTP and HTTPS forwarding, man-in-the-middle TLS inspection, custom DNS resolution including Cloudflare, and SSH-tunneled operation. The Grout mode offers ngrok-style public exposure of local applications, including authentication and wildcard domain routing.
The project ships with many example plugins, Docker images, Homebrew packages, and testing helpers. It targets developers who need programmable network plumbing without pulling in large external dependencies beyond Python.
Key features
- Forward and reverse HTTP proxy
- TLS interception plugins
- DNS-over-HTTPS resolvers
- Grout localhost tunneling
- Async threadless execution
- Embedded web server mode
- Extensible plugin API
- Docker and Homebrew installs
Use cases
- Run a local debugging proxy
- Intercept TLS for testing
- Expose localhost like a tunnel
- Embed a proxy in Python apps
- Customize proxy behavior with plugins
Open-source alternative to