Fix fqdn socks5 outbound connection

This commit is contained in:
世界 2022-09-25 14:42:39 +08:00
parent fb6b3b0401
commit b00b6b9e25
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -74,7 +74,7 @@ func (h *Socks) DialContext(ctx context.Context, network string, destination M.S
default: default:
return nil, E.Extend(N.ErrUnknownNetwork, network) return nil, E.Extend(N.ErrUnknownNetwork, network)
} }
if destination.IsFqdn() { if h.resolve && destination.IsFqdn() {
addrs, err := h.router.LookupDefault(ctx, destination.Fqdn) addrs, err := h.router.LookupDefault(ctx, destination.Fqdn)
if err != nil { if err != nil {
return nil, err return nil, err