add default tag selector
This commit is contained in:
@@ -477,13 +477,19 @@ func BuildConfig(opt ConfigOptions, input option.Options) (*option.Options, erro
|
|||||||
IdleTimeout: option.Duration(opt.URLTestInterval.Duration().Nanoseconds() * 10),
|
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{
|
selector := option.Outbound{
|
||||||
Type: C.TypeSelector,
|
Type: C.TypeSelector,
|
||||||
Tag: OutboundSelectTag,
|
Tag: OutboundSelectTag,
|
||||||
SelectorOptions: option.SelectorOutboundOptions{
|
SelectorOptions: option.SelectorOutboundOptions{
|
||||||
Outbounds: append([]string{urlTest.Tag}, tags...),
|
Outbounds: append([]string{urlTest.Tag}, tags...),
|
||||||
Default: urlTest.Tag,
|
Default: defaultSelect,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user