slinger_mitm/lib.rs
1//! MITM Proxy with Transparent Traffic Interception
2//!
3//! This crate provides a man-in-the-middle (MITM) proxy implementation similar to Burp Suite,
4//! allowing transparent interception and modification of HTTP/HTTPS traffic.
5//!
6//! # Features
7//!
8//! - Automatic CA certificate generation
9//! - Transparent HTTPS interception using rustls backend
10//! - Traffic interception and modification interfaces
11//! - Reuses slinger's Socket implementation
12//!
13//! # Example
14//!
15//! ```no_run
16//! use slinger_mitm::{MitmProxy, MitmConfig};
17//!
18//! #[tokio::main]
19//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
20//! let config = MitmConfig::default();
21//! let proxy = MitmProxy::new(config).await?;
22//! proxy.start("127.0.0.1:8080").await?;
23//! Ok(())
24//! }
25//! ```
26
27mod ca;
28mod error;
29mod interceptor;
30mod proxy;
31mod server;
32mod socks5;
33
34pub use ca::{CertificateAuthority, CertificateManager};
35pub use error::{Error, Result};
36pub use interceptor::{
37 Interceptor, InterceptorFactory, InterceptorHandler, LoggingInterceptor, MitmRequest,
38 MitmResponse,
39};
40pub use proxy::{MitmConfig, MitmProxy};
41pub use server::{ProxyServer, ProxyServerBuilder};
42pub use socks5::{Socks5Server, TargetAddr};
43
44#[cfg(test)]
45mod tests {
46 #[test]
47 fn it_works() {
48 let result = 2 + 2;
49 assert_eq!(result, 4);
50 }
51}