1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! `foundation_proxy` — reverse proxy with health-check routing, weighted load
//! balancing, HTTP forwarding, and raw TCP passthrough.
//!
//! **Stage 1 (this crate's current scope): the data plane.** It binds an HTTP
//! front end, routes by `Host` + longest `path_prefix` (wildcard hosts
//! supported), load-balances with weighted round-robin over only healthy,
//! `Active`, under-capacity backends, runs per-backend health probes, forwards
//! HTTP (stripping hop-by-hop headers, appending `X-Forwarded-*`), relays
//! WebSocket upgrades, and passes `tcp://` backends through byte-for-byte.
//!
//! TLS/ACME/Cloudflare, state persistence, Unix-socket RPC, and the `proxy!`
//! macro are later stages.
//!
//! **Three config paths** (all converge on `ProxyConfig`):
//! 1. `proxy!` macro — compile-time, type-checked, single binary (later stage)
//! 2. Programmatic builder — runtime, dynamic, full Rust
//! 3. `proxy.toml` file — reloadable, clap `--config` arg
//!
//! # Runtime requirement
//! [`ProxyServer::start`] serves via `foundation_http`, which submits
//! connections to a valtron pool. Callers **must** initialise a pool
//! (`foundation_core::valtron::initialize_pool`) and hold its guard for the
//! server's lifetime.
pub use ;
pub use SharedHttpClient;
pub use ProxyHandler;
pub use ;
pub use ;
pub use Router;
pub use ;
pub use ProxyServer;
pub use ProxyState;
pub use proxy;