This commit is contained in:
yuzuki999 2023-07-24 16:59:59 +08:00
parent 1c68cd80c8
commit 968da8effd

View File

@ -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
}