Expand description
§eggress-embed
Stable Rust embed API for starting and controlling an eggress proxy in-process.
This crate wraps the internal runtime, config, and server infrastructure behind a minimal, binding-friendly surface. Python bindings (PyO3) in later phases will wrap this API.
§Quick start (blocking)
use eggress_embed::{EggressService, EggressConfig};
let config = EggressConfig::from_toml_str(r#"
version = 1
[[listeners]]
name = "socks"
bind = "127.0.0.1:0"
protocols = ["socks5"]
"#).unwrap();
let handle = EggressService::new(config).start_blocking().unwrap();
let addrs = handle.bound_addresses();
println!("listening on {:?}", addrs);
handle.shutdown_blocking().unwrap();§Quick start (async)
use eggress_embed::{EggressService, EggressConfig};
let config = EggressConfig::from_toml_str(r#"
version = 1
[[listeners]]
name = "http"
bind = "127.0.0.1:0"
protocols = ["http"]
"#).unwrap();
let handle = EggressService::new(config).start().await.unwrap();
let status = handle.status();
println!("generation: {}", status.generation);
handle.shutdown().await.unwrap();Modules§
- outbound
- Native outbound connector for proxy chains.
Structs§
- Bound
Addresses - Addresses the service is listening on.
- Eggress
Config - Parsed and validated eggress configuration.
- Eggress
Handle - Handle to a running eggress service.
- Eggress
Service - Pre-start service builder.
- Listener
Address - A single listener’s bound address.
- Listener
Status - Detailed status of a single listener.
- Service
Status - Current service status.
Enums§
- Eggress
Error - Stable error type for the embed API.
- Reload
Outcome - Outcome of a configuration reload attempt.