torana

Using it as a library

The proxy engine is a separate crate, torana-core, with none of the standalone binary's listener/signal machinery.

Embed it inside a hyper server you already run instead of running torana as a separate process:

embed ProxyEngine
use torana_core::{Config, ProxyEngine, Metrics};
use std::sync::Arc;

let engine = ProxyEngine::new(config, Arc::new(metrics));
engine.spawn_health_probers().await;

// inside your own service_fn:
let response = engine.handle(req, client_addr, "http").await?;

Server (what the torana binary uses) is a thin wrapper around ProxyEngine that adds listener binding, SIGHUP reload, and graceful shutdown on top. Read torana-core/src/server.rs if you want that full behavior instead of wiring it up yourself.

Next: signals & reloads.