ginuerzh
d432d28f81
refactor(handler/relay): split handler.go -> observe.go, fix observeStats event-loss bug (break->fallthrough)
...
Extract checkRateLimit and observeStats into their own file (observe.go).
Fix the one-tick event-loss bug in observeStats where the retry path used
'unconditional break' instead of fallthrough, causing events collected
after a successful retry to be discarded.
Add 87 unit tests across 7 files (helpers, metadata, conn, handler,
connect, forward, bind) covering all handler modes, error paths,
observer/stats integration, and conn wrapper edge cases.
handler.go: -43 lines (unused observer import, extracted functions)
observe.go: +52 lines (checkRateLimit, observeStats with fallthrough fix)
test files: +1959 lines
2026-06-02 23:51:19 +08:00
ginuerzh
c7d16962ec
add service option for plugin
2025-08-29 23:36:31 +08:00
ginuerzh
b597467858
add context for conn
2025-08-04 19:29:38 +08:00
ginuerzh
f71351f5ef
add interface xnet.SrcAddr/DstAddr
2025-08-03 10:15:53 +08:00
ginuerzh
d9a2f44a78
add src field for logger and recorder
2025-07-02 21:35:02 +08:00
ginuerzh
fc12e33786
router handler: add cache for sd service
2025-02-09 16:16:44 +08:00
ginuerzh
379d9a73ad
service: add limiter.scope option
2025-01-20 23:22:58 +08:00
ginuerzh
06d993023f
add traffic reset for stats
2024-12-24 20:11:22 +08:00
ginuerzh
79b6b9138e
add limiterRefreshInterval option for limiter
2024-11-14 20:16:09 +08:00
ginuerzh
618d042001
add input/ouput fields for log
2024-10-16 22:16:34 +08:00
ginuerzh
24547b4332
add ClientAddr for websocket conn
2024-10-16 20:46:45 +08:00
ginuerzh
27242d0b66
recorder: add input/output traffic stats for handler recorder object
2024-10-11 20:32:56 +08:00
ginuerzh
c42a44abb6
add sniffer utility
2024-10-02 22:51:23 +08:00
ginuerzh
e22aa91571
add route for recorder
2024-09-24 20:20:15 +08:00
ginuerzh
ce2da421fa
fix recorder clientIP
2024-09-15 18:37:49 +08:00
ginuerzh
b39aa63f75
add clientIP for handler recorder object
2024-09-15 18:28:24 +08:00
ginuerzh
69455ace9d
add handler recorder
2024-09-14 23:21:25 +08:00
ginuerzh
31c482c649
add scope param for traffic limiter
2024-08-31 09:30:04 +08:00
ginuerzh
c1d0887a9b
add port range support for service
2024-07-08 22:38:21 +08:00
ginuerzh
6d819a0c06
add observePeriod option for observer
2024-06-13 21:22:29 +08:00
ginuerzh
3d2a7b7d3b
move x/internal/ctx to x/ctx
2024-01-30 18:19:39 +08:00
ginuerzh
c959fc2f73
add observer
2024-01-03 20:55:06 +08:00
ginuerzh
88cc6ff4d5
add traffic limiter for proxy handler
2023-11-18 18:28:09 +08:00
ginuerzh
9584bdbf4c
rm tunnel from relay
2023-11-14 22:35:46 +08:00
ginuerzh
497915f465
add tunnel handler and connector
2023-10-15 15:39:25 +08:00
ginuerzh
5488076801
add recorder for relay tunnel endpoint
2023-10-14 21:06:03 +08:00
ginuerzh
6a36ebcc9f
add proxy protocol support for relay tunnel and rtcp
2023-10-08 19:49:03 +08:00
ginuerzh
ea585fc25d
add reload and plugin support for hop
2023-09-28 21:04:15 +08:00
ginuerzh
ddc3c9392e
add client addr for auth plugin
2023-09-21 19:59:56 +08:00
ginuerzh
1760151500
add HTTP plugin
2023-09-20 22:56:43 +08:00
ginuerzh
674a70cd23
add client ID for plugin service
2023-09-19 22:31:37 +08:00
ginuerzh
92db078642
add network feature for relay
2023-09-16 21:47:40 +08:00
ginuerzh
32c8188351
add plugin system
2023-04-18 20:52:56 +08:00
ginuerzh
09ee29091b
fix relay connect handler
2023-02-14 18:53:57 +08:00
ginuerzh
e2d5d50b4b
relay: use service for rtcp bind handler
2023-02-04 18:38:21 +08:00
ginuerzh
416405b1f0
add UDP support for reverse proxy tunnel
2023-02-02 19:18:10 +08:00
ginuerzh
66234239e4
add http node settings
2023-01-29 20:31:13 +08:00
ginuerzh
24037aba7b
relay: added private tunnel
2023-01-29 11:55:26 +08:00
ginuerzh
40360f0c6f
add Close() for relay handler
2023-01-17 22:11:05 +08:00
ginuerzh
82cd924c86
add tunnel feature for relay
2023-01-14 13:15:15 +08:00
ginuerzh
1a1c038fd7
update chain route
2022-09-20 11:48:51 +08:00
ginuerzh
01d7dc77c6
update limiter
2022-09-14 20:00:35 +08:00
ginuerzh
a3346ad246
add pkgs from core
2022-04-04 12:44:35 +08:00
ginuerzh
36947bcbd9
fix imports
2022-03-16 20:06:34 +08:00
ginuerzh
9397cb5351
initial commit
2022-03-14 20:27:14 +08:00