Allow direct outbounds without domain_resolver

This commit is contained in:
世界
2025-04-01 21:32:49 +08:00
parent 4e11a3585a
commit ac7bc587cb
2 changed files with 8 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ type Options struct {
ResolverOnDetour bool
NewDialer bool
LegacyDNSDialer bool
DirectOutbound bool
}
// TODO: merge with NewWithOptions
@@ -108,7 +109,7 @@ func NewWithOptions(options Options) (N.Dialer, error) {
dnsQueryOptions.Transport = dnsTransport.Default()
} else if options.NewDialer {
return nil, E.New("missing domain resolver for domain server address")
} else {
} else if !options.DirectOutbound {
deprecated.Report(options.Context, deprecated.OptionMissingDomainResolver)
}
}