core: v2ray.com/core/app/router Index | Files

package router

import "v2ray.com/core/app/router"

Index

Package Files

balancing.go condition.go condition_geoip.go config.go config.pb.go errors.generated.go router.go

Variables

var Config_DomainStrategy_name = map[int32]string{
    0:  "AsIs",
    1:  "UseIp",
    2:  "IpIfNonMatch",
    3:  "IpOnDemand",
}
var Config_DomainStrategy_value = map[string]int32{
    "AsIs":         0,
    "UseIp":        1,
    "IpIfNonMatch": 2,
    "IpOnDemand":   3,
}
var Domain_Type_name = map[int32]string{
    0:  "Plain",
    1:  "Regex",
    2:  "Domain",
    3:  "Full",
}
var Domain_Type_value = map[string]int32{
    "Plain":  0,
    "Regex":  1,
    "Domain": 2,
    "Full":   3,
}

type AttributeMatcher Uses

type AttributeMatcher struct {
    // contains filtered or unexported fields
}

func NewAttributeMatcher Uses

func NewAttributeMatcher(code string) (*AttributeMatcher, error)

func (*AttributeMatcher) Apply Uses

func (m *AttributeMatcher) Apply(ctx *Context) bool

func (*AttributeMatcher) Match Uses

func (m *AttributeMatcher) Match(attrs map[string]interface{}) bool

type Balancer Uses

type Balancer struct {
    // contains filtered or unexported fields
}

func (*Balancer) PickOutbound Uses

func (b *Balancer) PickOutbound() (string, error)

type BalancingRule Uses

type BalancingRule struct {
    Tag                  string   `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
    OutboundSelector     []string `protobuf:"bytes,2,rep,name=outbound_selector,json=outboundSelector,proto3" json:"outbound_selector,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*BalancingRule) Build Uses

func (br *BalancingRule) Build(ohm outbound.Manager) (*Balancer, error)

func (*BalancingRule) Descriptor Uses

func (*BalancingRule) Descriptor() ([]byte, []int)

func (*BalancingRule) GetOutboundSelector Uses

func (m *BalancingRule) GetOutboundSelector() []string

func (*BalancingRule) GetTag Uses

func (m *BalancingRule) GetTag() string

func (*BalancingRule) ProtoMessage Uses

func (*BalancingRule) ProtoMessage()

func (*BalancingRule) Reset Uses

func (m *BalancingRule) Reset()

func (*BalancingRule) String Uses

func (m *BalancingRule) String() string

func (*BalancingRule) XXX_DiscardUnknown Uses

func (m *BalancingRule) XXX_DiscardUnknown()

func (*BalancingRule) XXX_Marshal Uses

func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BalancingRule) XXX_Merge Uses

func (m *BalancingRule) XXX_Merge(src proto.Message)

func (*BalancingRule) XXX_Size Uses

func (m *BalancingRule) XXX_Size() int

func (*BalancingRule) XXX_Unmarshal Uses

func (m *BalancingRule) XXX_Unmarshal(b []byte) error

type BalancingStrategy Uses

type BalancingStrategy interface {
    PickOutbound([]string) string
}

type CIDR Uses

type CIDR struct {
    // IP address, should be either 4 or 16 bytes.
    Ip  []byte `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"`
    // Number of leading ones in the network mask.
    Prefix               uint32   `protobuf:"varint,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

IP for routing decision, in CIDR form.

func (*CIDR) Descriptor Uses

func (*CIDR) Descriptor() ([]byte, []int)

func (*CIDR) GetIp Uses

func (m *CIDR) GetIp() []byte

func (*CIDR) GetPrefix Uses

func (m *CIDR) GetPrefix() uint32

func (*CIDR) ProtoMessage Uses

func (*CIDR) ProtoMessage()

func (*CIDR) Reset Uses

func (m *CIDR) Reset()

func (*CIDR) String Uses

func (m *CIDR) String() string

func (*CIDR) XXX_DiscardUnknown Uses

func (m *CIDR) XXX_DiscardUnknown()

func (*CIDR) XXX_Marshal Uses

func (m *CIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CIDR) XXX_Merge Uses

func (m *CIDR) XXX_Merge(src proto.Message)

func (*CIDR) XXX_Size Uses

func (m *CIDR) XXX_Size() int

func (*CIDR) XXX_Unmarshal Uses

func (m *CIDR) XXX_Unmarshal(b []byte) error

type CIDRList Uses

type CIDRList []*CIDR

CIDRList is an alias of []*CIDR to provide sort.Interface.

func (*CIDRList) Len Uses

func (l *CIDRList) Len() int

Len implements sort.Interface.

func (*CIDRList) Less Uses

func (l *CIDRList) Less(i int, j int) bool

Less implements sort.Interface.

func (*CIDRList) Swap Uses

func (l *CIDRList) Swap(i int, j int)

Swap implements sort.Interface.

type Condition Uses

type Condition interface {
    Apply(ctx *Context) bool
}

type ConditionChan Uses

type ConditionChan []Condition

func NewConditionChan Uses

func NewConditionChan() *ConditionChan

func (*ConditionChan) Add Uses

func (v *ConditionChan) Add(cond Condition) *ConditionChan

func (*ConditionChan) Apply Uses

func (v *ConditionChan) Apply(ctx *Context) bool

func (*ConditionChan) Len Uses

func (v *ConditionChan) Len() int

type Config Uses

type Config struct {
    DomainStrategy       Config_DomainStrategy `protobuf:"varint,1,opt,name=domain_strategy,json=domainStrategy,proto3,enum=v2ray.core.app.router.Config_DomainStrategy" json:"domain_strategy,omitempty"`
    Rule                 []*RoutingRule        `protobuf:"bytes,2,rep,name=rule,proto3" json:"rule,omitempty"`
    BalancingRule        []*BalancingRule      `protobuf:"bytes,3,rep,name=balancing_rule,json=balancingRule,proto3" json:"balancing_rule,omitempty"`
    XXX_NoUnkeyedLiteral struct{}              `json:"-"`
    XXX_unrecognized     []byte                `json:"-"`
    XXX_sizecache        int32                 `json:"-"`
}

func (*Config) Descriptor Uses

func (*Config) Descriptor() ([]byte, []int)

func (*Config) GetBalancingRule Uses

func (m *Config) GetBalancingRule() []*BalancingRule

func (*Config) GetDomainStrategy Uses

func (m *Config) GetDomainStrategy() Config_DomainStrategy

func (*Config) GetRule Uses

func (m *Config) GetRule() []*RoutingRule

func (*Config) ProtoMessage Uses

func (*Config) ProtoMessage()

func (*Config) Reset Uses

func (m *Config) Reset()

func (*Config) String Uses

func (m *Config) String() string

func (*Config) XXX_DiscardUnknown Uses

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal Uses

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge Uses

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size Uses

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal Uses

func (m *Config) XXX_Unmarshal(b []byte) error

type Config_DomainStrategy Uses

type Config_DomainStrategy int32
const (
    // Use domain as is.
    Config_AsIs Config_DomainStrategy = 0
    // Always resolve IP for domains.
    Config_UseIp Config_DomainStrategy = 1
    // Resolve to IP if the domain doesn't match any rules.
    Config_IpIfNonMatch Config_DomainStrategy = 2
    // Resolve to IP if any rule requires IP matching.
    Config_IpOnDemand Config_DomainStrategy = 3
)

func (Config_DomainStrategy) EnumDescriptor Uses

func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int)

func (Config_DomainStrategy) String Uses

func (x Config_DomainStrategy) String() string

type Context Uses

type Context struct {
    Inbound  *session.Inbound
    Outbound *session.Outbound
    Content  *session.Content
    // contains filtered or unexported fields
}

func (*Context) GetTargetIPs Uses

func (c *Context) GetTargetIPs() []net.IP

type Domain Uses

type Domain struct {
    // Domain matching type.
    Type Domain_Type `protobuf:"varint,1,opt,name=type,proto3,enum=v2ray.core.app.router.Domain_Type" json:"type,omitempty"`
    // Domain value.
    Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
    // Attributes of this domain. May be used for filtering.
    Attribute            []*Domain_Attribute `protobuf:"bytes,3,rep,name=attribute,proto3" json:"attribute,omitempty"`
    XXX_NoUnkeyedLiteral struct{}            `json:"-"`
    XXX_unrecognized     []byte              `json:"-"`
    XXX_sizecache        int32               `json:"-"`
}

Domain for routing decision.

func (*Domain) Descriptor Uses

func (*Domain) Descriptor() ([]byte, []int)

func (*Domain) GetAttribute Uses

func (m *Domain) GetAttribute() []*Domain_Attribute

func (*Domain) GetType Uses

func (m *Domain) GetType() Domain_Type

func (*Domain) GetValue Uses

func (m *Domain) GetValue() string

func (*Domain) ProtoMessage Uses

func (*Domain) ProtoMessage()

func (*Domain) Reset Uses

func (m *Domain) Reset()

func (*Domain) String Uses

func (m *Domain) String() string

func (*Domain) XXX_DiscardUnknown Uses

func (m *Domain) XXX_DiscardUnknown()

func (*Domain) XXX_Marshal Uses

func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Domain) XXX_Merge Uses

func (m *Domain) XXX_Merge(src proto.Message)

func (*Domain) XXX_Size Uses

func (m *Domain) XXX_Size() int

func (*Domain) XXX_Unmarshal Uses

func (m *Domain) XXX_Unmarshal(b []byte) error

type DomainMatcher Uses

type DomainMatcher struct {
    // contains filtered or unexported fields
}

func NewDomainMatcher Uses

func NewDomainMatcher(domains []*Domain) (*DomainMatcher, error)

func (*DomainMatcher) Apply Uses

func (m *DomainMatcher) Apply(ctx *Context) bool

func (*DomainMatcher) ApplyDomain Uses

func (m *DomainMatcher) ApplyDomain(domain string) bool

type Domain_Attribute Uses

type Domain_Attribute struct {
    Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
    // Types that are valid to be assigned to TypedValue:
    //	*Domain_Attribute_BoolValue
    //	*Domain_Attribute_IntValue
    TypedValue           isDomain_Attribute_TypedValue `protobuf_oneof:"typed_value"`
    XXX_NoUnkeyedLiteral struct{}                      `json:"-"`
    XXX_unrecognized     []byte                        `json:"-"`
    XXX_sizecache        int32                         `json:"-"`
}

func (*Domain_Attribute) Descriptor Uses

func (*Domain_Attribute) Descriptor() ([]byte, []int)

func (*Domain_Attribute) GetBoolValue Uses

func (m *Domain_Attribute) GetBoolValue() bool

func (*Domain_Attribute) GetIntValue Uses

func (m *Domain_Attribute) GetIntValue() int64

func (*Domain_Attribute) GetKey Uses

func (m *Domain_Attribute) GetKey() string

func (*Domain_Attribute) GetTypedValue Uses

func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue

func (*Domain_Attribute) ProtoMessage Uses

func (*Domain_Attribute) ProtoMessage()

func (*Domain_Attribute) Reset Uses

func (m *Domain_Attribute) Reset()

func (*Domain_Attribute) String Uses

func (m *Domain_Attribute) String() string

func (*Domain_Attribute) XXX_DiscardUnknown Uses

func (m *Domain_Attribute) XXX_DiscardUnknown()

func (*Domain_Attribute) XXX_Marshal Uses

func (m *Domain_Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Domain_Attribute) XXX_Merge Uses

func (m *Domain_Attribute) XXX_Merge(src proto.Message)

func (*Domain_Attribute) XXX_OneofWrappers Uses

func (*Domain_Attribute) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*Domain_Attribute) XXX_Size Uses

func (m *Domain_Attribute) XXX_Size() int

func (*Domain_Attribute) XXX_Unmarshal Uses

func (m *Domain_Attribute) XXX_Unmarshal(b []byte) error

type Domain_Attribute_BoolValue Uses

type Domain_Attribute_BoolValue struct {
    BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
}

type Domain_Attribute_IntValue Uses

type Domain_Attribute_IntValue struct {
    IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"`
}

type Domain_Type Uses

type Domain_Type int32

Type of domain value.

const (
    // The value is used as is.
    Domain_Plain Domain_Type = 0
    // The value is used as a regular expression.
    Domain_Regex Domain_Type = 1
    // The value is a root domain.
    Domain_Domain Domain_Type = 2
    // The value is a domain.
    Domain_Full Domain_Type = 3
)

func (Domain_Type) EnumDescriptor Uses

func (Domain_Type) EnumDescriptor() ([]byte, []int)

func (Domain_Type) String Uses

func (x Domain_Type) String() string

type GeoIP Uses

type GeoIP struct {
    CountryCode          string   `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
    Cidr                 []*CIDR  `protobuf:"bytes,2,rep,name=cidr,proto3" json:"cidr,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*GeoIP) Descriptor Uses

func (*GeoIP) Descriptor() ([]byte, []int)

func (*GeoIP) GetCidr Uses

func (m *GeoIP) GetCidr() []*CIDR

func (*GeoIP) GetCountryCode Uses

func (m *GeoIP) GetCountryCode() string

func (*GeoIP) ProtoMessage Uses

func (*GeoIP) ProtoMessage()

func (*GeoIP) Reset Uses

func (m *GeoIP) Reset()

func (*GeoIP) String Uses

func (m *GeoIP) String() string

func (*GeoIP) XXX_DiscardUnknown Uses

func (m *GeoIP) XXX_DiscardUnknown()

func (*GeoIP) XXX_Marshal Uses

func (m *GeoIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GeoIP) XXX_Merge Uses

func (m *GeoIP) XXX_Merge(src proto.Message)

func (*GeoIP) XXX_Size Uses

func (m *GeoIP) XXX_Size() int

func (*GeoIP) XXX_Unmarshal Uses

func (m *GeoIP) XXX_Unmarshal(b []byte) error

type GeoIPList Uses

type GeoIPList struct {
    Entry                []*GeoIP `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*GeoIPList) Descriptor Uses

func (*GeoIPList) Descriptor() ([]byte, []int)

func (*GeoIPList) GetEntry Uses

func (m *GeoIPList) GetEntry() []*GeoIP

func (*GeoIPList) ProtoMessage Uses

func (*GeoIPList) ProtoMessage()

func (*GeoIPList) Reset Uses

func (m *GeoIPList) Reset()

func (*GeoIPList) String Uses

func (m *GeoIPList) String() string

func (*GeoIPList) XXX_DiscardUnknown Uses

func (m *GeoIPList) XXX_DiscardUnknown()

func (*GeoIPList) XXX_Marshal Uses

func (m *GeoIPList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GeoIPList) XXX_Merge Uses

func (m *GeoIPList) XXX_Merge(src proto.Message)

func (*GeoIPList) XXX_Size Uses

func (m *GeoIPList) XXX_Size() int

func (*GeoIPList) XXX_Unmarshal Uses

func (m *GeoIPList) XXX_Unmarshal(b []byte) error

type GeoIPMatcher Uses

type GeoIPMatcher struct {
    // contains filtered or unexported fields
}

func (*GeoIPMatcher) Init Uses

func (m *GeoIPMatcher) Init(cidrs []*CIDR) error

func (*GeoIPMatcher) Match Uses

func (m *GeoIPMatcher) Match(ip net.IP) bool

Match returns true if the given ip is included by the GeoIP.

type GeoIPMatcherContainer Uses

type GeoIPMatcherContainer struct {
    // contains filtered or unexported fields
}

GeoIPMatcherContainer is a container for GeoIPMatchers. It keeps unique copies of GeoIPMatcher by country code.

func (*GeoIPMatcherContainer) Add Uses

func (c *GeoIPMatcherContainer) Add(geoip *GeoIP) (*GeoIPMatcher, error)

Add adds a new GeoIP set into the container. If the country code of GeoIP is not empty, GeoIPMatcherContainer will try to find an existing one, instead of adding a new one.

type GeoSite Uses

type GeoSite struct {
    CountryCode          string    `protobuf:"bytes,1,opt,name=country_code,json=countryCode,proto3" json:"country_code,omitempty"`
    Domain               []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"`
    XXX_NoUnkeyedLiteral struct{}  `json:"-"`
    XXX_unrecognized     []byte    `json:"-"`
    XXX_sizecache        int32     `json:"-"`
}

func (*GeoSite) Descriptor Uses

func (*GeoSite) Descriptor() ([]byte, []int)

func (*GeoSite) GetCountryCode Uses

func (m *GeoSite) GetCountryCode() string

func (*GeoSite) GetDomain Uses

func (m *GeoSite) GetDomain() []*Domain

func (*GeoSite) ProtoMessage Uses

func (*GeoSite) ProtoMessage()

func (*GeoSite) Reset Uses

func (m *GeoSite) Reset()

func (*GeoSite) String Uses

func (m *GeoSite) String() string

func (*GeoSite) XXX_DiscardUnknown Uses

func (m *GeoSite) XXX_DiscardUnknown()

func (*GeoSite) XXX_Marshal Uses

func (m *GeoSite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GeoSite) XXX_Merge Uses

func (m *GeoSite) XXX_Merge(src proto.Message)

func (*GeoSite) XXX_Size Uses

func (m *GeoSite) XXX_Size() int

func (*GeoSite) XXX_Unmarshal Uses

func (m *GeoSite) XXX_Unmarshal(b []byte) error

type GeoSiteList Uses

type GeoSiteList struct {
    Entry                []*GeoSite `protobuf:"bytes,1,rep,name=entry,proto3" json:"entry,omitempty"`
    XXX_NoUnkeyedLiteral struct{}   `json:"-"`
    XXX_unrecognized     []byte     `json:"-"`
    XXX_sizecache        int32      `json:"-"`
}

func (*GeoSiteList) Descriptor Uses

func (*GeoSiteList) Descriptor() ([]byte, []int)

func (*GeoSiteList) GetEntry Uses

func (m *GeoSiteList) GetEntry() []*GeoSite

func (*GeoSiteList) ProtoMessage Uses

func (*GeoSiteList) ProtoMessage()

func (*GeoSiteList) Reset Uses

func (m *GeoSiteList) Reset()

func (*GeoSiteList) String Uses

func (m *GeoSiteList) String() string

func (*GeoSiteList) XXX_DiscardUnknown Uses

func (m *GeoSiteList) XXX_DiscardUnknown()

func (*GeoSiteList) XXX_Marshal Uses

func (m *GeoSiteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GeoSiteList) XXX_Merge Uses

func (m *GeoSiteList) XXX_Merge(src proto.Message)

func (*GeoSiteList) XXX_Size Uses

func (m *GeoSiteList) XXX_Size() int

func (*GeoSiteList) XXX_Unmarshal Uses

func (m *GeoSiteList) XXX_Unmarshal(b []byte) error

type InboundTagMatcher Uses

type InboundTagMatcher struct {
    // contains filtered or unexported fields
}

func NewInboundTagMatcher Uses

func NewInboundTagMatcher(tags []string) *InboundTagMatcher

func (*InboundTagMatcher) Apply Uses

func (v *InboundTagMatcher) Apply(ctx *Context) bool

type MultiGeoIPMatcher Uses

type MultiGeoIPMatcher struct {
    // contains filtered or unexported fields
}

func NewMultiGeoIPMatcher Uses

func NewMultiGeoIPMatcher(geoips []*GeoIP, onSource bool) (*MultiGeoIPMatcher, error)

func (*MultiGeoIPMatcher) Apply Uses

func (m *MultiGeoIPMatcher) Apply(ctx *Context) bool

type NetworkMatcher Uses

type NetworkMatcher struct {
    // contains filtered or unexported fields
}

func NewNetworkMatcher Uses

func NewNetworkMatcher(network []net.Network) NetworkMatcher

func (NetworkMatcher) Apply Uses

func (v NetworkMatcher) Apply(ctx *Context) bool

type PortMatcher Uses

type PortMatcher struct {
    // contains filtered or unexported fields
}

func NewPortMatcher Uses

func NewPortMatcher(list *net.PortList) *PortMatcher

func (*PortMatcher) Apply Uses

func (v *PortMatcher) Apply(ctx *Context) bool

type ProtocolMatcher Uses

type ProtocolMatcher struct {
    // contains filtered or unexported fields
}

func NewProtocolMatcher Uses

func NewProtocolMatcher(protocols []string) *ProtocolMatcher

func (*ProtocolMatcher) Apply Uses

func (m *ProtocolMatcher) Apply(ctx *Context) bool

type RandomStrategy Uses

type RandomStrategy struct {
}

func (*RandomStrategy) PickOutbound Uses

func (s *RandomStrategy) PickOutbound(tags []string) string

type Router Uses

type Router struct {
    // contains filtered or unexported fields
}

Router is an implementation of routing.Router.

func (*Router) Close Uses

func (*Router) Close() error

Close implements common.Closable.

func (*Router) Init Uses

func (r *Router) Init(config *Config, d dns.Client, ohm outbound.Manager) error

Init initializes the Router.

func (*Router) PickRoute Uses

func (r *Router) PickRoute(ctx context.Context) (string, error)

func (*Router) Start Uses

func (*Router) Start() error

Start implements common.Runnable.

func (*Router) Type Uses

func (*Router) Type() interface{}

Type implement common.HasType.

type RoutingRule Uses

type RoutingRule struct {
    // Types that are valid to be assigned to TargetTag:
    //	*RoutingRule_Tag
    //	*RoutingRule_BalancingTag
    TargetTag isRoutingRule_TargetTag `protobuf_oneof:"target_tag"`
    // List of domains for target domain matching.
    Domain []*Domain `protobuf:"bytes,2,rep,name=domain,proto3" json:"domain,omitempty"`
    // List of CIDRs for target IP address matching.
    // Deprecated. Use geoip below.
    Cidr []*CIDR `protobuf:"bytes,3,rep,name=cidr,proto3" json:"cidr,omitempty"` // Deprecated: Do not use.
    // List of GeoIPs for target IP address matching. If this entry exists, the cidr above will have no effect.
    // GeoIP fields with the same country code are supposed to contain exactly same content. They will be merged during runtime.
    // For customized GeoIPs, please leave country code empty.
    Geoip []*GeoIP `protobuf:"bytes,10,rep,name=geoip,proto3" json:"geoip,omitempty"`
    // A range of port [from, to]. If the destination port is in this range, this rule takes effect.
    // Deprecated. Use port_list.
    PortRange *net.PortRange `protobuf:"bytes,4,opt,name=port_range,json=portRange,proto3" json:"port_range,omitempty"` // Deprecated: Do not use.
    // List of ports.
    PortList *net.PortList `protobuf:"bytes,14,opt,name=port_list,json=portList,proto3" json:"port_list,omitempty"`
    // List of networks. Deprecated. Use networks.
    NetworkList *net.NetworkList `protobuf:"bytes,5,opt,name=network_list,json=networkList,proto3" json:"network_list,omitempty"` // Deprecated: Do not use.
    // List of networks for matching.
    Networks []net.Network `protobuf:"varint,13,rep,packed,name=networks,proto3,enum=v2ray.core.common.net.Network" json:"networks,omitempty"`
    // List of CIDRs for source IP address matching.
    SourceCidr []*CIDR `protobuf:"bytes,6,rep,name=source_cidr,json=sourceCidr,proto3" json:"source_cidr,omitempty"` // Deprecated: Do not use.
    // List of GeoIPs for source IP address matching. If this entry exists, the source_cidr above will have no effect.
    SourceGeoip          []*GeoIP `protobuf:"bytes,11,rep,name=source_geoip,json=sourceGeoip,proto3" json:"source_geoip,omitempty"`
    UserEmail            []string `protobuf:"bytes,7,rep,name=user_email,json=userEmail,proto3" json:"user_email,omitempty"`
    InboundTag           []string `protobuf:"bytes,8,rep,name=inbound_tag,json=inboundTag,proto3" json:"inbound_tag,omitempty"`
    Protocol             []string `protobuf:"bytes,9,rep,name=protocol,proto3" json:"protocol,omitempty"`
    Attributes           string   `protobuf:"bytes,15,opt,name=attributes,proto3" json:"attributes,omitempty"`
    XXX_NoUnkeyedLiteral struct{} `json:"-"`
    XXX_unrecognized     []byte   `json:"-"`
    XXX_sizecache        int32    `json:"-"`
}

func (*RoutingRule) BuildCondition Uses

func (rr *RoutingRule) BuildCondition() (Condition, error)

func (*RoutingRule) Descriptor Uses

func (*RoutingRule) Descriptor() ([]byte, []int)

func (*RoutingRule) GetAttributes Uses

func (m *RoutingRule) GetAttributes() string

func (*RoutingRule) GetBalancingTag Uses

func (m *RoutingRule) GetBalancingTag() string

func (*RoutingRule) GetCidr Uses

func (m *RoutingRule) GetCidr() []*CIDR

Deprecated: Do not use.

func (*RoutingRule) GetDomain Uses

func (m *RoutingRule) GetDomain() []*Domain

func (*RoutingRule) GetGeoip Uses

func (m *RoutingRule) GetGeoip() []*GeoIP

func (*RoutingRule) GetInboundTag Uses

func (m *RoutingRule) GetInboundTag() []string

func (*RoutingRule) GetNetworkList Uses

func (m *RoutingRule) GetNetworkList() *net.NetworkList

Deprecated: Do not use.

func (*RoutingRule) GetNetworks Uses

func (m *RoutingRule) GetNetworks() []net.Network

func (*RoutingRule) GetPortList Uses

func (m *RoutingRule) GetPortList() *net.PortList

func (*RoutingRule) GetPortRange Uses

func (m *RoutingRule) GetPortRange() *net.PortRange

Deprecated: Do not use.

func (*RoutingRule) GetProtocol Uses

func (m *RoutingRule) GetProtocol() []string

func (*RoutingRule) GetSourceCidr Uses

func (m *RoutingRule) GetSourceCidr() []*CIDR

Deprecated: Do not use.

func (*RoutingRule) GetSourceGeoip Uses

func (m *RoutingRule) GetSourceGeoip() []*GeoIP

func (*RoutingRule) GetTag Uses

func (m *RoutingRule) GetTag() string

func (*RoutingRule) GetTargetTag Uses

func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag

func (*RoutingRule) GetUserEmail Uses

func (m *RoutingRule) GetUserEmail() []string

func (*RoutingRule) ProtoMessage Uses

func (*RoutingRule) ProtoMessage()

func (*RoutingRule) Reset Uses

func (m *RoutingRule) Reset()

func (*RoutingRule) String Uses

func (m *RoutingRule) String() string

func (*RoutingRule) XXX_DiscardUnknown Uses

func (m *RoutingRule) XXX_DiscardUnknown()

func (*RoutingRule) XXX_Marshal Uses

func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RoutingRule) XXX_Merge Uses

func (m *RoutingRule) XXX_Merge(src proto.Message)

func (*RoutingRule) XXX_OneofWrappers Uses

func (*RoutingRule) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*RoutingRule) XXX_Size Uses

func (m *RoutingRule) XXX_Size() int

func (*RoutingRule) XXX_Unmarshal Uses

func (m *RoutingRule) XXX_Unmarshal(b []byte) error

type RoutingRule_BalancingTag Uses

type RoutingRule_BalancingTag struct {
    BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"`
}

type RoutingRule_Tag Uses

type RoutingRule_Tag struct {
    Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"`
}

type Rule Uses

type Rule struct {
    Tag       string
    Balancer  *Balancer
    Condition Condition
}

func (*Rule) Apply Uses

func (r *Rule) Apply(ctx *Context) bool

func (*Rule) GetTag Uses

func (r *Rule) GetTag() (string, error)

type UserMatcher Uses

type UserMatcher struct {
    // contains filtered or unexported fields
}

func NewUserMatcher Uses

func NewUserMatcher(users []string) *UserMatcher

func (*UserMatcher) Apply Uses

func (v *UserMatcher) Apply(ctx *Context) bool

Package router imports 19 packages (graph) and is imported by 11 packages. Updated 2019-04-09. Refresh now. Tools for package owners.