How zerodenet/zero works
Zero is a Rust network-proxy kernel that can run as a local gateway, edge node, or server. Its principal workflow is to accept traffic through configured inbound protocols, route it using rules and outbound groups, and relay it through selected outbound protocols. Operators configure and control the runtime through CLI, HTTP, or IPC; optional event dispatch and sinks provide a separate observability path. The README documents these product capabilities, while the sampled excerpts and source index establish only some internal links; uncertain relationships are omitted.
Main entry points: runtime.rs Proxy runtime · mod.rs Protocol adapters · services.rs Application services · network.rs Event dispatcher
Components 22
Configuration and control
- CLI
src/cli.rs - Configuration
crates/config/src/model/mod.rs - Config validation
crates/config/src/validate.rs - Application services
src/application/services.rs - HTTP control
src/http_adapter/mod.rs - HTTP handlers
src/http_adapter/handlers.rs - IPC control
src/ipc/client.rs
Proxy runtime
- Engine
crates/engine/src/runtime.rs - Proxy runtime
crates/proxy/src/runtime.rs - Rule routing
crates/rule/src/query.rs - TUN routes
crates/proxy/src/inbound/tun/routes.rs
Network protocols
- Protocol adapters
crates/proxy/src/adapters/mod.rs - SOCKS5 UDP
protocols/socks5/src/udp/session.rs - Shadowsocks UDP
protocols/shadowsocks/src/udp/client.rs - Mieru client
protocols/mieru/src/client.rs - VLESS REALITY
protocols/vless/src/reality/reality_client_connection.rs
Network services
- DNS services
crates/dns/src/lib.rs - TCP/IP stack
crates/stack/src/packet.rs
Events and sinks
- Event dispatcher
crates/connector/src/network.rs - Webhook sink
crates/connector/src/webhook.rs - JSONL sink
crates/connector/src/jsonl.rs
Other components
- Operator
Connections 21
- Operator → CLI: runs
README.md - Operator → HTTP control: controls over HTTP
README.md - Operator → IPC control: controls over IPC
README.md - CLI → Application services: starts services
- Configuration → Config validation: validated by
README.md - Application services → Engine: starts
src/application/services.rs - HTTP control → HTTP handlers: routes requests
src/http_adapter/mod.rs - HTTP handlers → Engine: queries runtime
- Configuration → Proxy runtime: configures runtime
README.md - Proxy runtime → Rule routing: routes traffic
README.md - Proxy runtime → Protocol adapters: dispatches traffic
crates/proxy/src/runtime.rs - Protocol adapters → SOCKS5 UDP: supports SOCKS5
README.md - Protocol adapters → Shadowsocks UDP: supports Shadowsocks
README.md - Protocol adapters → Mieru client: supports mieru
README.md - Protocol adapters → VLESS REALITY: supports VLESS
README.md - Proxy runtime → TUN routes: manages routes
crates/proxy/src/inbound/tun/routes.rs - Proxy runtime → DNS services: provides DNS
README.md - Proxy runtime → TCP/IP stack: uses packet stack
- Application services → Event dispatcher: starts dispatcher
src/application/services.rs - Event dispatcher → Webhook sink: publishes events
crates/connector/src/webhook.rs - Event dispatcher → JSONL sink: writes events