mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-04 10:48:49 +00:00
Routing config: Add processName (#5489)
This commit is contained in:
@@ -106,6 +106,14 @@ 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 conds.Len() == 0 {
|
||||
return nil, errors.New("this rule has no effective fields").AtWarning()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user