1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-01-07 01:46:33 -05:00
v2fly/app/router/rules/config.go

28 lines
449 B
Go
Raw Normal View History

2015-12-07 16:47:47 -05:00
package rules
2015-11-21 15:43:40 -05:00
import (
2016-08-20 14:55:45 -04:00
v2net "v2ray.com/core/common/net"
2015-11-21 15:43:40 -05:00
)
2016-01-17 10:20:49 -05:00
type Rule struct {
Tag string
Condition Condition
2015-11-21 15:43:40 -05:00
}
2015-12-07 16:47:47 -05:00
2016-01-17 10:20:49 -05:00
func (this *Rule) Apply(dest v2net.Destination) bool {
return this.Condition.Apply(dest)
}
2016-05-16 03:25:34 -04:00
type DomainStrategy int
var (
DomainAsIs = DomainStrategy(0)
AlwaysUseIP = DomainStrategy(1)
UseIPIfNonMatch = DomainStrategy(2)
)
2016-01-17 10:20:49 -05:00
type RouterRuleConfig struct {
2016-05-16 03:25:34 -04:00
Rules []*Rule
DomainStrategy DomainStrategy
2015-12-07 16:47:47 -05:00
}