mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2025-01-03 04:50:11 +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{
|
return &Dns{
|
||||||
host: *config.DnsAddr,
|
host: *config.DnsAddr,
|
||||||
port: port,
|
port: port,
|
||||||
systemClient: client.NewSystemClient(),
|
systemClient: client.NewSystemResolver(),
|
||||||
generalClient: client.NewGeneralClient(net.JoinHostPort(addr, port)),
|
generalClient: client.NewGeneralResolver(net.JoinHostPort(addr, port)),
|
||||||
dohClient: client.NewDOHClient(addr),
|
dohClient: client.NewDOHResolver(addr),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ type DOHResolver struct {
|
|||||||
client *http.Client
|
client *http.Client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDOHClient(host string) *DOHResolver {
|
func NewDOHResolver(host string) *DOHResolver {
|
||||||
c := &http.Client{
|
c := &http.Client{
|
||||||
Timeout: 5 * time.Second,
|
Timeout: 5 * time.Second,
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
|
@ -18,7 +18,7 @@ type GeneralResolver struct {
|
|||||||
server string
|
server string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGeneralClient(server string) *GeneralResolver {
|
func NewGeneralResolver(server string) *GeneralResolver {
|
||||||
return &GeneralResolver{
|
return &GeneralResolver{
|
||||||
client: &dns.Client{},
|
client: &dns.Client{},
|
||||||
server: server,
|
server: server,
|
||||||
|
@ -9,7 +9,7 @@ type SystemResolver struct {
|
|||||||
*net.Resolver
|
*net.Resolver
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSystemClient() *SystemResolver {
|
func NewSystemResolver() *SystemResolver {
|
||||||
return &SystemResolver{
|
return &SystemResolver{
|
||||||
&net.Resolver{PreferGo: true},
|
&net.Resolver{PreferGo: true},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user