Developer Guide
This part is for people who change the code. It describes the Etemenanki workspace (the kernel crates and the standalone app) and katana, down to individual state machines, buffers and locks.
The code base at a glance
Section titled “The code base at a glance”| Crate or program | Role |
|---|---|
etemenanki-concepts |
The sans-I/O proxy model: server cores, client codecs, the per-connection runtimes, links and connectors. It contains no protocol code. |
etemenanki-environment |
Host-side networking: TCP and UDP dialers (plus an optional QUIC dialer) sharing one socket policy, and the route model. |
etemenanki-protocols |
Every protocol and transport: SOCKS, HTTP, Shadowsocks, Trojan, VLESS, VMess, Hysteria 2, WireGuard and TUN; TCP, TLS, WebSocket and gRPC; mux.cool and XUDP; DNS; sniffing. |
etemenanki-app |
The standalone proxy: configuration, inbound and outbound construction, router composition, generations and hot reload. |
katana |
The panel node agent, built on the first three crates: panel clients, node lifecycle, admission, traffic accounting, rate limiting and audit. |
Dependencies point one way, from the programs down to the concepts:
flowchart BT concepts["etemenanki-concepts"] environment["etemenanki-environment"] protocols["etemenanki-protocols"] app["etemenanki-app"] katana["katana"] environment --> concepts protocols --> environment app --> protocols katana --> protocols
Each arrow is a direct dependency; every crate also uses the ones further down directly. katana is a separate repository and takes the three library crates from a registry at a pinned version; the app is built together with them in one workspace.
Map of this guide
Section titled “Map of this guide”How the pages are written
Section titled “How the pages are written”Every page follows the same outline, as far as its subject allows:
- Responsibilities: what the component does, and what it deliberately leaves to others.
- Key types: the traits, structs and functions you will meet in the code, with their signatures.
- Data flow: how bytes, events or requests move through it, usually drawn as a Mermaid diagram.
- Invariants: what must always hold, and which mechanism guarantees it.
- Failure paths: errors, cancellation and shutdown.
- Limits: buffer sizes, timeouts and caps.
- Tests: which tests pin the behaviour down.
Source references
Section titled “Source references”The repositories are private, so these pages do not link into them. Code is named by repository-relative path and symbol, for example concepts/src/core.rs → ProxyCoreDecode. Line numbers are avoided because they move.
Under each page title, Source files lists the files the page describes and the revision they were last checked against. When any of those files changes after that revision, the page is re-checked.