From 968da8effdd831704142c318c42dab29ca582608 Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Mon, 24 Jul 2023 16:59:59 +0800 Subject: [PATCH] fix miss --- core/hy/resolver.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/hy/resolver.go b/core/hy/resolver.go index 8da3ea8..e1eacbe 100644 --- a/core/hy/resolver.go +++ b/core/hy/resolver.go @@ -1,9 +1,19 @@ package hy -//var errInvalidSyntax = errors.New("invalid syntax") +import ( + "crypto/tls" + "errors" + "github.com/Yuzuki616/hysteria/core/utils" + rdns "github.com/folbricht/routedns" + "net" + "net/url" + "strings" +) + +var errInvalidSyntax = errors.New("invalid syntax") func setResolver(dns string) error { - /*if net.ParseIP(dns) != nil { + if net.ParseIP(dns) != nil { // Just an IP address, treat as UDP 53 dns = "udp://" + net.JoinHostPort(dns, "53") } @@ -107,6 +117,6 @@ func setResolver(dns string) error { return errInvalidSyntax } cache := rdns.NewCache("cache", r, rdns.CacheOptions{}) - net.DefaultResolver = rdns.NewNetResolver(cache)*/ + net.DefaultResolver = rdns.NewNetResolver(cache) return nil }