Fix direct dialer not resolving domain

This commit is contained in:
世界 2024-08-20 18:56:50 +08:00
parent f6a1e123fc
commit 064fb9b873
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -28,13 +28,12 @@ func New(router adapter.Router, options option.DialerOptions) (N.Dialer, error)
} else { } else {
dialer = NewDetour(router, options.Detour) dialer = NewDetour(router, options.Detour)
} }
domainStrategy := dns.DomainStrategy(options.DomainStrategy) if options.Detour == "" {
if domainStrategy != dns.DomainStrategyAsIS || options.Detour == "" {
dialer = NewResolveDialer( dialer = NewResolveDialer(
router, router,
dialer, dialer,
options.Detour == "" && !options.TCPFastOpen, options.Detour == "" && !options.TCPFastOpen,
domainStrategy, dns.DomainStrategy(options.DomainStrategy),
time.Duration(options.FallbackDelay)) time.Duration(options.FallbackDelay))
} }
return dialer, nil return dialer, nil