mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-17 18:06:15 -05:00
28 lines
449 B
Go
28 lines
449 B
Go
package rules
|
|
|
|
import (
|
|
v2net "v2ray.com/core/common/net"
|
|
)
|
|
|
|
type Rule struct {
|
|
Tag string
|
|
Condition Condition
|
|
}
|
|
|
|
func (this *Rule) Apply(dest v2net.Destination) bool {
|
|
return this.Condition.Apply(dest)
|
|
}
|
|
|
|
type DomainStrategy int
|
|
|
|
var (
|
|
DomainAsIs = DomainStrategy(0)
|
|
AlwaysUseIP = DomainStrategy(1)
|
|
UseIPIfNonMatch = DomainStrategy(2)
|
|
)
|
|
|
|
type RouterRuleConfig struct {
|
|
Rules []*Rule
|
|
DomainStrategy DomainStrategy
|
|
}
|