ginuerzh
f8ddb193cb
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.
2026-05-30 16:27:20 +08:00
ginuerzh
776f045896
refactor(handler/forward): extract 6 helpers from remote Handle, add 44 unit tests
...
Extract newRecorderObject, selectTarget, sniffingDial, buildSniffer,
handleSniffedProtocol, and handleRawForwarding from Handle (200→87 lines).
Move nil Router guard before sniffing for early failure. Log previously
silent sniff and pipe errors at Debug level. Apply readTimeout to Pipe.
Append :0 when target addr lacks a port. Reorder metadata fields and
add doc comments on all exported symbols.
2026-05-28 20:40:13 +08:00
ginuerzh
6b932e35bf
sniffing websocket frame
2024-10-19 19:36:06 +08:00
ginuerzh
0ffed81601
add sniffer for forwarding handler
2024-10-14 21:18:38 +08:00
ginuerzh
8f994ab632
add handle options for sniffer
2024-10-10 22:49:56 +08:00
ginuerzh
6a36ebcc9f
add proxy protocol support for relay tunnel and rtcp
2023-10-08 19:49:03 +08:00
ginuerzh
46db8480fa
add timeout for sniffing
2023-05-21 15:47:51 +08:00
ginuerzh
1ff2bab1f0
add vhost for port forwarding
2022-11-11 22:23:36 +08:00
ginuerzh
09dbdbb03c
add backup filter
2022-09-02 11:52:44 +08:00
ginuerzh
a3346ad246
add pkgs from core
2022-04-04 12:44:35 +08:00