mirror of
https://github.com/nadoo/glider.git
synced 2026-11-19 07:09:42 +08:00
general: use builtin dns as resolver when dns enabled
This commit is contained in:
1 parent
851fc46104
commit
0e89d1879f
7 files changed
+24
-13
No files matched your search
@@ -1,8 +1,10 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@@ -76,6 +78,12 @@ func main() {
|
||||
}
|
||||
|
||||
d.Start()
|
||||
|
||||
net.DefaultResolver.PreferGo = true
|
||||
net.DefaultResolver.Dial = func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
d := net.Dialer{}
|
||||
return d.DialContext(ctx, "udp", conf.DNS)
|
||||
}
|
||||
}
|
||||
|
||||
// enable checkers
|
||||
|
||||
Reference in new issue
Block a user