mirror of
https://github.com/cmz0228/hysteria-dev.git
synced 2025-06-09 22:09:56 +00:00
chore: setResolver
This commit is contained in:
parent
c41d81886c
commit
ccbd959007
@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"io"
|
||||
@ -30,13 +29,7 @@ func client(config *clientConfig) {
|
||||
logrus.WithField("config", config.String()).Info("Client 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)
|
||||
}
|
||||
// TLS
|
||||
tlsConfig := &tls.Config{
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user