refactor: Outbound domain resolver

This commit is contained in:
世界
2025-01-12 12:45:27 +08:00
parent 364a055f77
commit 2cb5ff521a
25 changed files with 93 additions and 36 deletions

View File

@@ -77,6 +77,7 @@ type DialerOptions struct {
TCPMultiPath bool `json:"tcp_multi_path,omitempty"`
UDPFragment *bool `json:"udp_fragment,omitempty"`
UDPFragmentDefault bool `json:"-"`
DomainResolver string `json:"domain_resolver,omitempty"`
DomainStrategy DomainStrategy `json:"domain_strategy,omitempty"`
NetworkStrategy *NetworkStrategy `json:"network_strategy,omitempty"`
NetworkType badoption.Listable[InterfaceType] `json:"network_type,omitempty"`
@@ -107,6 +108,10 @@ func (o ServerOptions) Build() M.Socksaddr {
return M.ParseSocksaddrHostPort(o.Server, o.ServerPort)
}
func (o ServerOptions) ServerIsDomain() bool {
return M.IsDomainName(o.Server)
}
func (o *ServerOptions) TakeServerOptions() ServerOptions {
return *o
}