Commit Graph

32 Commits

Author SHA1 Message Date
ginuerzh 684a0ddf65 feat(dns): use system nameservers from /etc/resolv.conf as fallback
When no forwarder or dns metadata is configured, the DNS handler now
reads system nameservers from /etc/resolv.conf (Unix) before falling
back to the hardcoded 127.0.0.1:53 default. This makes the DNS proxy
work out-of-the-box without requiring explicit DNS server configuration.

Fixes go-gost/gost#89
2026-06-20 15:54:39 +08:00
ginuerzh 79718ee19e fix(handler/dns): buffer pool leak, write deadline, async error logging, EDNS0 buffer
Fix bufpool leak when PackBuffer fails by extracting packResponse helper.
Add write deadline before conn.Write to prevent goroutine hangs on slow
clients. Log async exchange errors instead of silently discarding them.
Raise defaultBufferSize from 1024 to 4096 to match EDNS0 standard.
Deduplicate lookupHosts TypeA/TypeAAAA branches.
2026-05-26 21:22:19 +08:00
ginuerzh dd76e9f685 fix(handler/dns): apply readTimeout, fix async context leak, add 40 tests
- Apply parsed readTimeout as connection read deadline (was dead code)
- Use context.WithoutCancel for async cache refresh goroutine
- Add doc comments to all exported symbols
- Add 40 tests covering metadata parsing, init, rate limiting,
  exchanger selection, host lookup, cache, bypass, async refresh,
  and concurrent request handling
2026-05-26 20:55:55 +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 208d18125c replace xnet.Transport by xnet.Pipe 2025-07-28 20:52:15 +08:00
ginuerzh 06d993023f add traffic reset for stats 2024-12-24 20:11:22 +08:00
ginuerzh 618d042001 add input/ouput fields for log 2024-10-16 22:16:34 +08:00
ginuerzh 27242d0b66 recorder: add input/output traffic stats for handler recorder object 2024-10-11 20:32:56 +08:00
ginuerzh 3c8add4b82 add traffic sniffing for handler 2024-09-27 15:55:28 +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 69455ace9d add handler recorder 2024-09-14 23:21:25 +08:00
ginuerzh c1d0887a9b add port range support for service 2024-07-08 22:38:21 +08:00
ginuerzh 936954ecf2 fix dns handler panic 2024-01-08 21:20:56 +08:00
ginuerzh cc4310106b fix race condition 2023-10-19 23:47:47 +08:00
ginuerzh 836cf6eade add network for bypass 2023-09-30 17:51:55 +08:00
ginuerzh ea585fc25d add reload and plugin support for hop 2023-09-28 21:04:15 +08:00
ginuerzh 32c8188351 add plugin system 2023-04-18 20:52:56 +08:00
ginuerzh de5ce1e1ca add async option for dns handler 2023-04-14 18:50:33 +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 00f7fa2997 add weight for selector 2022-09-02 17:23:59 +08:00
ginuerzh 9b695bc374 add chain group 2022-09-02 10:57:40 +08:00
ginuerzh d043ad94e7 add nodes field for forwarder 2022-08-25 21:35:37 +08:00
ginuerzh bdd239fb09 add list support for auther, admission and bypass 2022-08-23 21:49:49 +08:00
ginuerzh f3f3acd4e1 more fine-grained log level 2022-08-18 11:34:57 +08:00
ginuerzh a3346ad246 add pkgs from core 2022-04-04 12:44:35 +08:00
ginuerzh 1c69832f5a update udp listener 2022-04-03 22:24:47 +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