Skip to main content

Crate eggress_embed

Crate eggress_embed 

Source
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§

BoundAddresses
Addresses the service is listening on.
EggressConfig
Parsed and validated eggress configuration.
EggressHandle
Handle to a running eggress service.
EggressService
Pre-start service builder.
ListenerAddress
A single listener’s bound address.
ListenerStatus
Detailed status of a single listener.
ServiceStatus
Current service status.

Enums§

EggressError
Stable error type for the embed API.
ReloadOutcome
Outcome of a configuration reload attempt.