mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 06:15:51 +00:00
chore: rename dns constructors for dns resolver
This commit is contained in:
parent
442ae6840b
commit
f862e3efc7
@ -28,9 +28,9 @@ func NewResolver(config *util.Config) *Dns {
|
||||
return &Dns{
|
||||
host: *config.DnsAddr,
|
||||
port: port,
|
||||
systemClient: client.NewSystemClient(),
|
||||
generalClient: client.NewGeneralClient(net.JoinHostPort(addr, port)),
|
||||
dohClient: client.NewDOHClient(addr),
|
||||
systemClient: client.NewSystemResolver(),
|
||||
generalClient: client.NewGeneralResolver(net.JoinHostPort(addr, port)),
|
||||
dohClient: client.NewDOHResolver(addr),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ type DOHResolver struct {
|
||||
client *http.Client
|
||||
}
|
||||
|
||||
func NewDOHClient(host string) *DOHResolver {
|
||||
func NewDOHResolver(host string) *DOHResolver {
|
||||
c := &http.Client{
|
||||
Timeout: 5 * time.Second,
|
||||
Transport: &http.Transport{
|
||||
|
@ -18,7 +18,7 @@ type GeneralResolver struct {
|
||||
server string
|
||||
}
|
||||
|
||||
func NewGeneralClient(server string) *GeneralResolver {
|
||||
func NewGeneralResolver(server string) *GeneralResolver {
|
||||
return &GeneralResolver{
|
||||
client: &dns.Client{},
|
||||
server: server,
|
||||
|
@ -9,7 +9,7 @@ type SystemResolver struct {
|
||||
*net.Resolver
|
||||
}
|
||||
|
||||
func NewSystemClient() *SystemResolver {
|
||||
func NewSystemResolver() *SystemResolver {
|
||||
return &SystemResolver{
|
||||
&net.Resolver{PreferGo: true},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user