From 182e06e2e28aee08fa6f8f4508ae82ddb016d055 Mon Sep 17 00:00:00 2001 From: Hiddify <114227601+hiddify-com@users.noreply.github.com> Date: Sat, 1 Jun 2024 16:44:31 +0200 Subject: [PATCH] add default tag selector --- config/config.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 9703281..c6e2802 100644 --- a/config/config.go +++ b/config/config.go @@ -477,13 +477,19 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro IdleTimeout: option.Duration(opt.URLTestInterval.Duration().Nanoseconds() * 10), }, } + defaultSelect := urlTest.Tag + for _, tag := range tags { + if strings.Contains(tag, "§default§") { + defaultSelect = "§default§" + } + } selector := option.Outbound{ Type: C.TypeSelector, Tag: OutboundSelectTag, SelectorOptions: option.SelectorOutboundOptions{ Outbounds: append([]string{urlTest.Tag}, tags...), - Default: urlTest.Tag, + Default: defaultSelect, }, }