brainwires_proxy/lib.rs
1//! # brainwires-proxy
2//!
3//! Protocol-agnostic proxy framework for debugging app traffic.
4//!
5//! Compose transports, middleware, converters, and inspectors to build
6//! custom debugging proxies for any protocol.
7//!
8//! ## Features
9//!
10//! - **`http`** (default) — HTTP/HTTPS transport via hyper
11//! - **`websocket`** — WebSocket transport via tokio-tungstenite
12//! - **`tls`** — TLS termination via tokio-rustls
13//! - **`inspector-api`** — HTTP query API for captured traffic
14//! - **`full`** — All features enabled
15//!
16//! ## Quick Start
17//!
18//! ```rust,no_run
19//! use brainwires_proxy::builder::ProxyBuilder;
20//!
21//! # async fn example() -> brainwires_proxy::error::ProxyResult<()> {
22//! let proxy = ProxyBuilder::new()
23//! .listen_on("127.0.0.1:8080")
24//! .upstream_url("http://localhost:3000")
25//! .build()?;
26//!
27//! proxy.run().await
28//! # }
29//! ```
30
31pub mod config;
32pub mod error;
33pub mod request_id;
34pub mod types;
35
36pub mod convert;
37pub mod inspector;
38pub mod middleware;
39pub mod transport;
40
41pub mod builder;
42pub mod proxy;
43
44/// Convenience re-exports.
45pub mod prelude {
46 pub use crate::builder::ProxyBuilder;
47 pub use crate::config::ProxyConfig;
48 pub use crate::convert::{ConversionRegistry, Converter, FormatDetector, StreamConverter};
49 pub use crate::error::{ProxyError, ProxyResult};
50 pub use crate::middleware::{LayerAction, MiddlewareStack, ProxyLayer};
51 pub use crate::proxy::ProxyService;
52 pub use crate::request_id::RequestId;
53 pub use crate::transport::{TransportConnector, TransportListener};
54 pub use crate::types::{
55 Extensions, FormatId, ProxyBody, ProxyRequest, ProxyResponse, TransportKind,
56 };
57}