tokio-multi-proxy
An async, modular proxy with support for TCP, UDP, Unix sockets, TLS, and mutual TLS. Built on Tokio and Rustls.
✨ Features
- 🔌 Raw TCP passthrough
- 🌊 UDP datagram proxying
- 🧱 Unix Domain Socket bridging
- 🔐 TLS termination
- 🔐 Mutual TLS (mTLS) authentication
- ⚙️ Compile-time feature flags to minimize dependencies
📦 Install
Add to your Cargo.toml:
= { = "0.1.0", = ["tls", "mtls"] }
Or if using only TCP passthrough (no TLS):
= "0.1.0"
🚀 Examples
Run examples with:
🔧 Usage
TCP
start_tcp.await?;
TLS
start_tls_tcp.await?;
mTLS
start_mtls_tcp.await?;
🛠 Features
| Feature | Description |
|---|---|
passthrough |
Raw TCP proxying (default) |
tls |
TLS termination support |
mtls |
Mutual TLS (requires tls) |
Enable with:
🔐 Dev Certificate (for local testing)
# Optional mTLS CA
📚 Documentation
- API Docs (docs.rs)
- Build locally:
🪪 License
Licensed under either of:
- MIT
- Apache-2.0
👤 Author
Ahmed Masud — saf.ai
MIT/Apache dual-license. Contributions welcome!