mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-07-28 04:38:35 +00:00
chore: setResolver
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"github.com/lucas-clemente/quic-go"
|
||||
"github.com/lucas-clemente/quic-go/congestion"
|
||||
@@ -25,13 +24,7 @@ func server(config *serverConfig) {
|
||||
logrus.WithField("config", config.String()).Info("Server configuration loaded")
|
||||
// Resolver
|
||||
if len(config.Resolver) > 0 {
|
||||
net.DefaultResolver = &net.Resolver{
|
||||
PreferGo: true,
|
||||
Dial: func(ctx context.Context, network, address string) (net.Conn, error) {
|
||||
d := net.Dialer{}
|
||||
return d.DialContext(ctx, "udp", config.Resolver)
|
||||
},
|
||||
}
|
||||
setResolver(config.Resolver)
|
||||
}
|
||||
// Load TLS config
|
||||
var tlsConfig *tls.Config
|
||||
|
Reference in New Issue
Block a user