From 5a765dc7f90c2ebc9a11cd79dcfbd8a8b8d99fcd Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 26 Mar 2026 05:34:30 +0700 Subject: lib/dns: refactoring DoT and DoH to use address instead of port Using port makes the IP address of DoT and DoH listen on the same address with UDP. If we set ListenAddress to 0.0.0.0 and TLS termination is handled by proxy, this cause DoT and DoH will also listen on all addresses. --- lib/dns/server_example_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dns/server_example_test.go') diff --git a/lib/dns/server_example_test.go b/lib/dns/server_example_test.go index c9222885..c14f2888 100644 --- a/lib/dns/server_example_test.go +++ b/lib/dns/server_example_test.go @@ -51,7 +51,7 @@ func ExampleServer() { serverAddress = "127.0.0.1:5300" serverOptions = &ServerOptions{ ListenAddress: "127.0.0.1:5300", - HTTPPort: 8443, + DoHListen: "127.0.0.1:8443", TLSCertFile: "testdata/domain.crt", TLSPrivateKey: "testdata/domain.key", TLSAllowInsecure: true, -- cgit v1.3