fix
This commit is contained in:
parent
fa37f4a22f
commit
81c8f1d297
5
vendor/github.com/armon/go-socks5/resolver.go
generated
vendored
5
vendor/github.com/armon/go-socks5/resolver.go
generated
vendored
@ -2,6 +2,7 @@ package socks5
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,10 +15,12 @@ type NameResolver interface {
|
|||||||
type DNSResolver struct{}
|
type DNSResolver struct{}
|
||||||
|
|
||||||
func (d DNSResolver) Resolve(ctx context.Context, name string) (context.Context, netip.Addr, error) {
|
func (d DNSResolver) Resolve(ctx context.Context, name string) (context.Context, netip.Addr, error) {
|
||||||
addr, err := netip.ParseAddr(name)
|
ipAddr, err := net.ResolveIPAddr("ip", name)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ctx, netip.Addr{}, err
|
return ctx, netip.Addr{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addr := netip.MustParseAddr(ipAddr.String())
|
||||||
return ctx, addr, err
|
return ctx, addr, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user