Expand description
Minimal Tor-routed worker launching.
torzy starts one Tor SOCKS route per worker, prepares an isolated worker
workspace, and runs a caller-supplied shell command once per worker. The CLI
and library both call run, so embedded and command-line behavior stay on
the same code path.
The default command is intentionally local and quiet. Network checks are left to the caller-supplied command.
use torzy::{run, LaunchConfig};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let summary = run(
LaunchConfig {
envs: 5,
command: "printf 'worker=%s ready\\n' \"$TOR_WORKER_ID\"".to_string(),
..LaunchConfig::default()
},
None,
)
.await?;
println!("{} workers succeeded", summary.succeeded);
Ok(())
}Structs§
- Launch
Config - Configuration for one
torzyrun. - RunSummary
- JSON-friendly run summary that avoids command, route, path, and output data.
- Worker
Summary - JSON-friendly worker summary.
Enums§
- Stream
Kind - Output stream that produced a worker line.
- Torzy
Event - Runtime event emitted by
run. - Worker
Status - Final worker status.
Constants§
- DEFAULT_
COMMAND - Local default command used when no command is supplied.
Functions§
- expand_
command_ template - Expand command placeholders for a worker.
- generate_
tor_ routes - Generate local SOCKS route strings from a base port.
- redact_
line - Redact route strings, runtime paths, and public network-address tokens.
- run
- Run the configured Tor-routed workers.
- validate_
tor_ routes - Validate that explicit routes are non-empty, unique, and match worker count.