2026-07-25 04:02:08 +08:00
2026-07-25 04:02:08 +08:00
2026-07-25 04:02:08 +08:00

honk

English | 中文


English

honk is a Rust transparent-proxy engine for Linux, inspired by dae (eBPF datapath & config surface) and sing-box (outbound groups, multi-protocol dialers, Clash-compatible API).

It is not a line-for-line port of either project. The kernel path follows dae’s TC + match_set + dae0/daens model; the userspace outbound/control stack follows sing-box-oriented designs. honk means: dae sing.

Status: experimental (v0.0.1.alpha). honk is an early alpha release — expect breaking changes, incomplete features (see TODO), and limited real-world validation. Not recommended for production use.

License: GPL-3.0-only.

Documentation

Doc English 中文
Design doc/design.en.md doc/design.zh.md
Configuration doc/configuration.en.md doc/configuration.zh.md
Component reference doc/components.en.md doc/components.zh.md
Index doc/README.md same

Architecture (crates)

crates/
├── honk-core/          # Engine binary: control plane, DNS, relay, Clash API, eBPF attach
├── honk-config/        # Config schema + dae-syntax parser + share links
├── honk-outbound/      # Proxy handlers, groups, health checks
├── honk-ebpf-common/   # Shared no_std #[repr(C)] types (kernel ↔ userspace)
└── honk-ebpf/          # Kernel eBPF programs (bpfel-unknown-none; outside workspace)

High-level path: TC classify → redirect via dae0/daens → sk_lookup TPROXY listeners → userspace dial/relay. Details in the design doc.

Completed and verified (summary)

Status reflects the current tree and unit/integration tests. Prefer re-running cargo test --all on your machine for a live gate.

eBPF / datapath (maintainer focus)

  • TC LAN/WAN ingress & egress (L2/L3), bond/bridge slave attach
  • dae0 / dae0peer + daens delivery, sk_lookup + SockMap listeners
  • MatchSet routing machine, LPM (dest/src/MAC), domain bitmaps, must/OR/AND indices
  • Conntrack / redirect track / routing handoff maps
  • cgroup cookie→pid for process-name rules
  • DNS fast path (redirect DNS to userspace without full route loop)
  • Per-outbound OUTBOUND_STATS + EVENT_RINGBUF drain
  • Connectivity map fed by userspace health checks
  • Mock eBPF backend for unprivileged tests

Config & routing (userspace)

  • dae syntax load & validate
  • Share-link parse (ss/ssr/vmess/vless/trojan/anytls/hy2/tuic/juicity/…)
  • Userspace Router (domain/IP/port/proto/process/MAC/geosite/geoip)
  • TCP sniff (TLS SNI, HTTP Host); QUIC Initial SNI decrypt
  • Dial modes ip / domain / domain+ / domain++
  • Built-in direct node injection; block outbound

Outbound & groups

  • Handlers: Direct, Block, SOCKS5, SS(+2022), SSR, Trojan, Trojan-Go, VMess, VLESS, Hysteria2, TUIC, Juicity, AnyTLS
  • Shared transport (TLS/WS/gRPC) + h2mux (node.mux)
  • Groups: Selector / URLTest / LoadBalance / Fallback + nested groups
  • URLTest: tolerance, separate TCP/UDP picks, idle_timeout, interrupt_connections
  • AliveDialerSet: concurrent probes, hysteresis, TCP+UDP probes, eBPF push
  • Subscription fetch + background merge (in-memory nodes)

Review Status

  • ebpf pat
  • control plan
  • anytls / trojan / juicity /socks5
  • ss/ ssr/ vless/ vmess/ tuic
  • dns logic
  • ech
  • quic

TODO

  • UDP relay for VMess / VLESS / SSR / Trojan-Go
  • REALITY + uTLS (deferred — no mature rustls hooks)
  • smux/yamux; verified h2mux interop with official sing-box multiplex inbounds
  • Real DoT/DoH/DoQ/DoH3 upstreams (pooled TLS/H2/QUIC sessions)
  • Hysteria2 brutal (up/down Mbps), port hopping (mport/mhop), pinSHA256, QUIC receive-window/PMTUD knobs; live-verified against the official server
  • Hysteria2 residue: maxStreamReceiveWindow/maxConnReceiveWindow (no quinn autotuning equivalent), fastOpen, configurable UDP-session/connection idle timeouts (hardcoded 90s/120s)
  • Consolidate QUIC client options: QuicClientOptions for transport tuning, BoringQuicOptions for the TLS backend
  • FakeIP engine
  • Kernel-side eBPF DNS answer cache (userspace cache exists)
  • Consistent-hash load balancing (round-robin LoadBalance exists)
  • Broader live interop tests vs production peers; routine root-only netns gates

Prerequisites

  • Rust (edition 2024 / recent stable; eBPF object build needs nightly + bpf-linker)
  • Linux kernel 5.8+ for real eBPF
  • clang, llvm, libbpf headers for eBPF builds
# Debian/Ubuntu example
sudo apt-get install -y clang llvm libbpf-dev build-essential pkg-config

Quick start

# Workspace
cargo build --release
cargo test --all

# Engine with real eBPF (root)
cargo build --release -p honk-core --features ebpf
sudo ./target/release/honk-core --config /etc/honk/config.dae

# Dev without kernel eBPF
cargo run --release -p honk-core -- --config config.dae --mock-ebpf

Day-to-day tasks: see Justfile (just build-core, just run, just clean-all, …).

Docker

Default image builds honk-core without the ebpf feature (mock backend). For real eBPF, build with --features ebpf (nightly + bpf-linker in the build stage) or pass --bpf-object.

docker compose up -d
# privileged, host network, /sys + /etc/honk mounts — see docker-compose.yml

Configuration (sketch)

global {
    tproxy_port: 12345
    lan_interface: eth0
    dial_mode: domain
}

node {
    trojan-node: 'trojan://secret@example.com:443'
}

group {
    proxy {
        filter: name(keyword: 'node')
        policy: min_moving_avg
    }
}

routing {
    domain(suffix: google.com) -> proxy
    fallback: direct
}

Full guides: doc/configuration.en.md, doc/components.en.md.

Acknowledgments

  • dae / daed-rs — eBPF transparent proxy lineage
  • sing-box — outbound group & Clash API patterns
  • daeuniverse/outbound — protocol reference
  • juicity-rs by Markson Pigeonzilla Plus — Juicity protocol implementation reference; the wire-format alignment and live interop testing of honk's Juicity outbound were done against it
  • aya-rs — Rust eBPF

License

SPDX-License-Identifier: GPL-3.0-only
Copyright (c) 2025, glassyiris <honk@catmint.cc> and honk contributors
S
Description
Inspired by dae & sing-box
Readme GPL-3.0
101 MiB
0 Stars 1 Watchers 0 Forks
Languages
Rust 99.1%
Python 0.5%
Shell 0.3%