Fight for All
That is Beautiful
in the World.
This is the notebook of Ember Moth, also signed Siegfried Tschen.
Notes on network protocols and proxies, Rust and Go engineering, security research, and the occasional late-night essay — like a moth, chasing the light.
Latest writingRecent embers
All posts →代理节点端热路径的零分配改造:原则、五个模式与实测
代理节点端的热路径是"每秒几十万次的小操作":封一帧、加密一块、排队一个上传分片、发一个 UDP 报文。这类路径上每次操作多一次堆分配,单看 ns/op 几乎没有变化,但会以 GC assist、堆扫描和尾延迟抖动的形式在高负载下集体兑现。

让路由查询与规则数无关:代理路由索引的一次重新设计
代理软件的路由规则是一张有序表:逐条检查,第一条命中的规则决定出口。这个语义天然导致"规则越多、未命中越慢",因为一个不命中任何规则的请求要把整张表扫完,而带地理类别的规则每条都是几万个域名或网段。

用 smoltcp 做 TUN 代理的用户态栈:我们踩过的六个坑
上一篇讲了移动端为什么把 TCP 交还给内核。桌面端我们仍然用 smoltcp 跑用户态 TCP 栈,因为桌面没有 Extension 那样的内存墙,也不值得为省内存让每个载荷多穿一次 TUN。

把 TCP 交还给内核:TUN 代理里的 system netstack 设计与实测
移动端隧道进程的内存墙让用户态 TCP 栈(smoltcp)成了负担:每条连接要背几百 KiB 的固定缓冲,还要自己处理重传、拥塞和窗口。system netstack 换了一条路:不实现 TCP,而是把 TUN 里读到的 TCP 包原地做源 NAT,改写后写回 TUN……

Fight for all that is beautiful in the world
About this motto, and why I call myself Ember Moth.

Browse by topicFour phases
Protocols
Proxies, tunnels, traffic shaping and the transport layer.
03 POSTS →II.Security
Vulnerability analysis, exploit chains and defenses.
00 POSTS →III.Engineering
Rust and Go in practice: builds, tooling, cross-compiling.
03 POSTS →IV.Notes
Games, books, and half-formed thoughts at midnight.
01 POSTS →Open sourceThings I build
All projects →AstrLink
↗A local AI gateway for AI agents, unifying your subscriptions and API providers with smart routing and on-device privacy protection.
clash-rs
↗custom protocol network proxy
naive-rs
↗(no description)
sing-snell
↗Surge snell implemented in Go
cronet-go
↗Go bindings for naiveproxy.
Solaris
↗(no description)
The moth does not fear the flame —— Ember Moth
it simply remembers the moon.

