mirror of
https://github.com/xvzc/SpoofDPI.git
synced 2024-12-22 22:36:53 +00:00
rename custom client
This commit is contained in:
parent
26d69b54db
commit
67bee5a49a
@ -13,17 +13,17 @@ type DNSResult struct {
|
|||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomClient struct {
|
type GeneralClient struct {
|
||||||
server string
|
server string
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewGeneralClient(server string) *CustomClient {
|
func NewGeneralClient(server string) *GeneralClient {
|
||||||
return &CustomClient{
|
return &GeneralClient{
|
||||||
server: server,
|
server: server,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CustomClient) Resolve(ctx context.Context, host string, qTypes []uint16) ([]net.IPAddr, error) {
|
func (c *GeneralClient) Resolve(ctx context.Context, host string, qTypes []uint16) ([]net.IPAddr, error) {
|
||||||
sendMsg := func(ctx context.Context, msg *dns.Msg) (*dns.Msg, error) {
|
sendMsg := func(ctx context.Context, msg *dns.Msg) (*dns.Msg, error) {
|
||||||
clt := &dns.Client{}
|
clt := &dns.Client{}
|
||||||
resp, _, err := clt.Exchange(msg, c.server)
|
resp, _, err := clt.Exchange(msg, c.server)
|
||||||
@ -35,6 +35,6 @@ func (c *CustomClient) Resolve(ctx context.Context, host string, qTypes []uint16
|
|||||||
return addrs, err
|
return addrs, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *CustomClient) String() string {
|
func (c *GeneralClient) String() string {
|
||||||
return fmt.Sprintf("custom client(%s)", c.server)
|
return fmt.Sprintf("custom client(%s)", c.server)
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user