fix: let doh/dot server follow hosts and can remotely resolve itself ip

This commit is contained in:
wwqgtxx
2022-12-07 20:01:44 +08:00
parent e03fcd24dd
commit a6f7e1472b
7 changed files with 76 additions and 81 deletions

View File

@ -1,6 +1,8 @@
package dialer
import (
"github.com/Dreamacro/clash/component/resolver"
"go.uber.org/atomic"
)
@ -14,9 +16,9 @@ type option struct {
interfaceName string
addrReuse bool
routingMark int
direct bool
network int
prefer int
resolver resolver.Resolver
}
type Option func(opt *option)
@ -39,9 +41,9 @@ func WithRoutingMark(mark int) Option {
}
}
func WithDirect() Option {
func WithResolver(r resolver.Resolver) Option {
return func(opt *option) {
opt.direct = true
opt.resolver = r
}
}