1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-27 04:25:44 -05:00

Extract session information during routing as routing context

This commit is contained in:
Vigilans
2020-09-04 11:32:19 +08:00
parent 6981711fe5
commit f9d37b724c
10 changed files with 263 additions and 133 deletions

View File

@@ -5,6 +5,7 @@ package router
import (
"v2ray.com/core/common/net"
"v2ray.com/core/features/outbound"
"v2ray.com/core/features/routing"
)
// CIDRList is an alias of []*CIDR to provide sort.Interface.
@@ -59,7 +60,8 @@ func (r *Rule) GetTag() (string, error) {
return r.Tag, nil
}
func (r *Rule) Apply(ctx *Context) bool {
// Apply checks rule matching of current routing context.
func (r *Rule) Apply(ctx routing.Context) bool {
return r.Condition.Apply(ctx)
}