Files
reverse-proxy/Cargo.toml
glm-5.1 7ccb2ae64f feat: implement multi-listener TLS setup with ConnectInfo propagation
- Add server module that orchestrates the full startup sequence:
  parse config, init dynamic config, init shared state, bind health
  check, bind admin socket, bind all listener ports, load TLS config,
  start TCP listeners, start background tasks, signal readiness
- For each ListenerConfig: bind TCP listener, construct appropriate
  ServerConfig (manual or ACME via TlsMode), create TlsAcceptor
- ConnectInfo<SocketAddr> populated from TcpStream::peer_addr() BEFORE
  TLS wrapping via ConnectInfoService wrapper that inserts ConnectInfo
  into request extensions for each connection
- Per-listener axum::Router instances sharing Arc<ProxyState> via State
- Fail-fast: if any bind or TLS load fails, exit with non-zero code
- All ports bound before any connections accepted
- /health endpoint available on HTTPS listener(s) as fallback
  (proxy_router already includes /health route)
- sd_notify(READY=1) sent after all listeners started
- Use hyper_util for TLS connection serving with TowerToHyperService
  and ConnectInfoService to bridge ConnectInfo from pre-TLS peer_addr
- Add sd-notify dependency for systemd readiness notification
2026-06-11 13:38:39 +00:00

46 lines
1.2 KiB
TOML

[package]
name = "reverse-proxy"
version = "0.1.0"
edition = "2021"
license = "MIT OR Apache-2.0"
[lib]
name = "reverse_proxy"
path = "src/lib.rs"
[[bin]]
name = "reverse-proxy"
path = "src/main.rs"
[dependencies]
axum = "=0.8.9"
tokio = { version = "=1.45.1", features = ["full"] }
hyper = "=1.6.0"
hyper-util = { version = "=0.1.17", features = ["client-legacy", "http1", "http2", "tokio"] }
http-body-util = "=0.1.3"
hyper-rustls = { version = "=0.27.9", features = ["http1", "http2"] }
rustls-native-certs = "=0.8.1"
tower = "=0.5.2"
rustls = { version = "=0.23.28", features = ["aws_lc_rs"] }
tokio-rustls = "=0.26.2"
rustls-acme = { version = "=0.12.1", features = ["aws-lc-rs"] }
serde = { version = "=1.0.228", features = ["derive"] }
toml = "=0.8.23"
arc-swap = "=1.7.1"
tracing = "=0.1.41"
tracing-subscriber = { version = "=0.3.19", features = ["env-filter", "json"] }
rustls-pemfile = "=2.2.0"
rustls-pki-types = "=1.12.0"
clap = { version = "=4.6.1", features = ["derive"] }
signal-hook = "=0.3.18"
anyhow = "=1.0.102"
thiserror = "=2.0.18"
futures = "=0.3.31"
dashmap = "=6.1"
serde_json = "=1.0.140"
sd-notify = "=0.4"
[dev-dependencies]
rcgen = "=0.13"
reqwest = { version = "=0.12", features = ["json"] }
tempfile = "=3.20"