From 0a1889c4384f163fa3268157cf7c315b3ab68efd Mon Sep 17 00:00:00 2001 From: Puqns67 Date: Sat, 23 Nov 2024 19:36:40 +0800 Subject: [PATCH] Update some default vaule for me usecase --- template/render_dns.go | 8 ++++---- template/render_outbounds.go | 11 +++++------ 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/template/render_dns.go b/template/render_dns.go index 8564d2d..05adbbb 100644 --- a/template/render_dns.go +++ b/template/render_dns.go @@ -32,14 +32,14 @@ func (t *Template) renderDNS(metadata M.Metadata, options *option.Options) error } else if t.EnableFakeIP { domainStrategy = option.DomainStrategy(dns.DomainStrategyPreferIPv4) } else { - domainStrategy = option.DomainStrategy(dns.DomainStrategyUseIPv4) + domainStrategy = 0 } if t.DomainStrategyLocal != option.DomainStrategy(dns.DomainStrategyAsIS) { domainStrategyLocal = t.DomainStrategyLocal + if domainStrategyLocal == domainStrategy { + domainStrategyLocal = 0 + } } else { - domainStrategyLocal = option.DomainStrategy(dns.DomainStrategyPreferIPv4) - } - if domainStrategyLocal == domainStrategy { domainStrategyLocal = 0 } diff --git a/template/render_outbounds.go b/template/render_outbounds.go index 9486f02..e69fb61 100644 --- a/template/render_outbounds.go +++ b/template/render_outbounds.go @@ -23,7 +23,6 @@ func (t *Template) renderOutbounds(metadata M.Metadata, options *boxOption.Optio if defaultTag == "" { defaultTag = DefaultDefaultTag } - options.Route.Final = defaultTag directTag := t.DirectTag if directTag == "" { directTag = DefaultDirectTag @@ -33,16 +32,16 @@ func (t *Template) renderOutbounds(metadata M.Metadata, options *boxOption.Optio blockTag = DefaultBlockTag } options.Outbounds = []boxOption.Outbound{ - { - Tag: directTag, - Type: C.TypeDirect, - Options: common.Ptr(common.PtrValueOrDefault(t.CustomDirect)), - }, { Tag: defaultTag, Type: C.TypeSelector, Options: common.Ptr(common.PtrValueOrDefault(t.CustomSelector)), }, + { + Tag: directTag, + Type: C.TypeDirect, + Options: common.Ptr(common.PtrValueOrDefault(t.CustomDirect)), + }, } if disableRuleAction { options.Outbounds = append(options.Outbounds,