Skip to main content

Crate trojan_agent

Crate trojan_agent 

Source
Expand description

Trojan panel agent — connects to a centralized management panel via WebSocket, receives full configuration, boots the appropriate service, and reports heartbeat + traffic back.

§Usage

trojan agent -c agent.toml

The agent TOML only needs panel_url and token. Everything else (TLS certs, listen addresses, auth, chains) comes from the panel.

Re-exports§

pub use cli::AgentArgs;
pub use error::AgentError;

Modules§

cache
Local config cache for panel-down resilience.
cli
CLI entry point for the agent subcommand.
client
WebSocket client — connects to the panel, registers, and provides send/receive channels.
collector
Per-user traffic accumulator.
config
Agent local configuration.
error
Agent error types.
protocol
Re-export protocol types from trojan-protocol for backwards compatibility.
reporter
Background heartbeat and traffic batch reporter.
runner
Service bootstrap — starts the appropriate service based on node type.