1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-27 06:19:12 -04:00

support range list in routing rule

This commit is contained in:
Darien Raymond
2019-02-24 23:43:00 +01:00
parent 4d23411d80
commit 95583b5031
11 changed files with 267 additions and 81 deletions

View File

@@ -5,6 +5,7 @@ package router
import (
"context"
net "v2ray.com/core/common/net"
"v2ray.com/core/features/outbound"
)
@@ -83,8 +84,10 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
conds.Add(NewInboundTagMatcher(rr.InboundTag))
}
if rr.PortRange != nil {
conds.Add(NewPortMatcher(*rr.PortRange))
if rr.PortList != nil {
conds.Add(NewPortMatcher(rr.PortList))
} else if rr.PortRange != nil {
conds.Add(NewPortMatcher(&net.PortList{Range: []*net.PortRange{rr.PortRange}}))
}
if len(rr.Networks) > 0 {