refactor(handler/forward/remote): split handler into 6 focused files with 41 tests

Split the 339-line handler monolith and 1169-line test blob into 11 files
(5 source + 6 test) following the handler/forward/local/ pattern.

Source files: handler.go (core), forward.go (raw forwarding),
sniffing.go (SnifferBuilder + protocol dispatch), util.go (errors +
recorder + rate limit), metadata.go (config parsing).

Fixes: add sync.Mutex for hop access (race), use sentinel errors for
errors.Is compatibility, add nil-addr guard in checkRateLimit, reuse
SnifferBuilder via Build() instead of per-call construction.
This commit is contained in:
ginuerzh
2026-05-30 16:27:20 +08:00
parent 32c3d33afd
commit f8ddb193cb
11 changed files with 1411 additions and 1267 deletions
File diff suppressed because it is too large Load Diff