Routing config: Replace processName with process (full-name/abs-path/abs-folder) (#5496)

About `self/` & `xray/`: https://github.com/XTLS/Xray-core/pull/5496#issuecomment-3714620380

Replaces https://github.com/XTLS/Xray-core/pull/5489
This commit is contained in:
风扇滑翔翼
2026-01-06 21:57:11 +08:00
committed by RPRX
parent d9025857fe
commit 446df149bd
9 changed files with 187 additions and 141 deletions

View File

@@ -126,12 +126,8 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
conds.Add(matcher)
}
if len(rr.ProcessName) > 0 {
refinedNames := make([]string, 0, len(rr.ProcessName))
for _, name := range rr.ProcessName {
refinedNames = append(refinedNames, strings.TrimSuffix(name, ".exe"))
}
conds.Add(&ProcessNameMatcher{refinedNames})
if len(rr.Process) > 0 {
conds.Add(NewProcessNameMatcher(rr.Process))
}
if conds.Len() == 0 {