Documentation ¶
Index ¶
- Variables
- type AttributeMatcher
- type Balancer
- type BalancingRule
- func (br *BalancingRule) Build(ohm outbound.Manager) (*Balancer, error)
- func (*BalancingRule) Descriptor() ([]byte, []int)
- func (m *BalancingRule) GetOutboundSelector() []string
- func (m *BalancingRule) GetTag() string
- func (*BalancingRule) ProtoMessage()
- func (m *BalancingRule) Reset()
- func (m *BalancingRule) String() string
- func (m *BalancingRule) XXX_DiscardUnknown()
- func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BalancingRule) XXX_Merge(src proto.Message)
- func (m *BalancingRule) XXX_Size() int
- func (m *BalancingRule) XXX_Unmarshal(b []byte) error
- type BalancingStrategy
- type CIDR
- func (*CIDR) Descriptor() ([]byte, []int)
- func (m *CIDR) GetIp() []byte
- func (m *CIDR) GetPrefix() uint32
- func (*CIDR) ProtoMessage()
- func (m *CIDR) Reset()
- func (m *CIDR) String() string
- func (m *CIDR) XXX_DiscardUnknown()
- func (m *CIDR) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CIDR) XXX_Merge(src proto.Message)
- func (m *CIDR) XXX_Size() int
- func (m *CIDR) XXX_Unmarshal(b []byte) error
- type CIDRList
- type Condition
- type ConditionChan
- type Config
- func (*Config) Descriptor() ([]byte, []int)
- func (m *Config) GetBalancingRule() []*BalancingRule
- func (m *Config) GetDomainStrategy() Config_DomainStrategy
- func (m *Config) GetRule() []*RoutingRule
- func (*Config) ProtoMessage()
- func (m *Config) Reset()
- func (m *Config) String() string
- func (m *Config) XXX_DiscardUnknown()
- func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Config) XXX_Merge(src proto.Message)
- func (m *Config) XXX_Size() int
- func (m *Config) XXX_Unmarshal(b []byte) error
- type Config_DomainStrategy
- type Context
- type Domain
- func (*Domain) Descriptor() ([]byte, []int)
- func (m *Domain) GetAttribute() []*Domain_Attribute
- func (m *Domain) GetType() Domain_Type
- func (m *Domain) GetValue() string
- func (*Domain) ProtoMessage()
- func (m *Domain) Reset()
- func (m *Domain) String() string
- func (m *Domain) XXX_DiscardUnknown()
- func (m *Domain) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Domain) XXX_Merge(src proto.Message)
- func (m *Domain) XXX_Size() int
- func (m *Domain) XXX_Unmarshal(b []byte) error
- type DomainMatcher
- type Domain_Attribute
- func (*Domain_Attribute) Descriptor() ([]byte, []int)
- func (m *Domain_Attribute) GetBoolValue() bool
- func (m *Domain_Attribute) GetIntValue() int64
- func (m *Domain_Attribute) GetKey() string
- func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue
- func (*Domain_Attribute) ProtoMessage()
- func (m *Domain_Attribute) Reset()
- func (m *Domain_Attribute) String() string
- func (m *Domain_Attribute) XXX_DiscardUnknown()
- func (m *Domain_Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Domain_Attribute) XXX_Merge(src proto.Message)
- func (*Domain_Attribute) XXX_OneofWrappers() []interface{}
- func (m *Domain_Attribute) XXX_Size() int
- func (m *Domain_Attribute) XXX_Unmarshal(b []byte) error
- type Domain_Attribute_BoolValue
- type Domain_Attribute_IntValue
- type Domain_Type
- type GeoIP
- func (*GeoIP) Descriptor() ([]byte, []int)
- func (m *GeoIP) GetCidr() []*CIDR
- func (m *GeoIP) GetCountryCode() string
- func (*GeoIP) ProtoMessage()
- func (m *GeoIP) Reset()
- func (m *GeoIP) String() string
- func (m *GeoIP) XXX_DiscardUnknown()
- func (m *GeoIP) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GeoIP) XXX_Merge(src proto.Message)
- func (m *GeoIP) XXX_Size() int
- func (m *GeoIP) XXX_Unmarshal(b []byte) error
- type GeoIPList
- func (*GeoIPList) Descriptor() ([]byte, []int)
- func (m *GeoIPList) GetEntry() []*GeoIP
- func (*GeoIPList) ProtoMessage()
- func (m *GeoIPList) Reset()
- func (m *GeoIPList) String() string
- func (m *GeoIPList) XXX_DiscardUnknown()
- func (m *GeoIPList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GeoIPList) XXX_Merge(src proto.Message)
- func (m *GeoIPList) XXX_Size() int
- func (m *GeoIPList) XXX_Unmarshal(b []byte) error
- type GeoIPMatcher
- type GeoIPMatcherContainer
- type GeoSite
- func (*GeoSite) Descriptor() ([]byte, []int)
- func (m *GeoSite) GetCountryCode() string
- func (m *GeoSite) GetDomain() []*Domain
- func (*GeoSite) ProtoMessage()
- func (m *GeoSite) Reset()
- func (m *GeoSite) String() string
- func (m *GeoSite) XXX_DiscardUnknown()
- func (m *GeoSite) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GeoSite) XXX_Merge(src proto.Message)
- func (m *GeoSite) XXX_Size() int
- func (m *GeoSite) XXX_Unmarshal(b []byte) error
- type GeoSiteList
- func (*GeoSiteList) Descriptor() ([]byte, []int)
- func (m *GeoSiteList) GetEntry() []*GeoSite
- func (*GeoSiteList) ProtoMessage()
- func (m *GeoSiteList) Reset()
- func (m *GeoSiteList) String() string
- func (m *GeoSiteList) XXX_DiscardUnknown()
- func (m *GeoSiteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GeoSiteList) XXX_Merge(src proto.Message)
- func (m *GeoSiteList) XXX_Size() int
- func (m *GeoSiteList) XXX_Unmarshal(b []byte) error
- type InboundTagMatcher
- type MultiGeoIPMatcher
- type NetworkMatcher
- type PortMatcher
- type ProtocolMatcher
- type RandomStrategy
- type Router
- type RoutingRule
- func (rr *RoutingRule) BuildCondition() (Condition, error)
- func (*RoutingRule) Descriptor() ([]byte, []int)
- func (m *RoutingRule) GetAttributes() string
- func (m *RoutingRule) GetBalancingTag() string
- func (m *RoutingRule) GetCidr() []*CIDRdeprecated
- func (m *RoutingRule) GetDomain() []*Domain
- func (m *RoutingRule) GetGeoip() []*GeoIP
- func (m *RoutingRule) GetInboundTag() []string
- func (m *RoutingRule) GetNetworkList() *net.NetworkListdeprecated
- func (m *RoutingRule) GetNetworks() []net.Network
- func (m *RoutingRule) GetPortList() *net.PortList
- func (m *RoutingRule) GetPortRange() *net.PortRangedeprecated
- func (m *RoutingRule) GetProtocol() []string
- func (m *RoutingRule) GetSourceCidr() []*CIDRdeprecated
- func (m *RoutingRule) GetSourceGeoip() []*GeoIP
- func (m *RoutingRule) GetTag() string
- func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag
- func (m *RoutingRule) GetUserEmail() []string
- func (*RoutingRule) ProtoMessage()
- func (m *RoutingRule) Reset()
- func (m *RoutingRule) String() string
- func (m *RoutingRule) XXX_DiscardUnknown()
- func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *RoutingRule) XXX_Merge(src proto.Message)
- func (*RoutingRule) XXX_OneofWrappers() []interface{}
- func (m *RoutingRule) XXX_Size() int
- func (m *RoutingRule) XXX_Unmarshal(b []byte) error
- type RoutingRule_BalancingTag
- type RoutingRule_Tag
- type Rule
- type UserMatcher
Constants ¶
This section is empty.
Variables ¶
View Source
var Config_DomainStrategy_name = map[int32]string{
0: "AsIs",
1: "UseIp",
2: "IpIfNonMatch",
3: "IpOnDemand",
}
View Source
var Config_DomainStrategy_value = map[string]int32{
"AsIs": 0,
"UseIp": 1,
"IpIfNonMatch": 2,
"IpOnDemand": 3,
}
View Source
var Domain_Type_name = map[int32]string{
0: "Plain",
1: "Regex",
2: "Domain",
3: "Full",
}
View Source
var Domain_Type_value = map[string]int32{
"Plain": 0,
"Regex": 1,
"Domain": 2,
"Full": 3,
}
Functions ¶
This section is empty.
Types ¶
type AttributeMatcher ¶
type AttributeMatcher struct {
// contains filtered or unexported fields
}
func NewAttributeMatcher ¶
func NewAttributeMatcher(code string) (*AttributeMatcher, error)
func (*AttributeMatcher) Apply ¶
func (m *AttributeMatcher) Apply(ctx *Context) bool
func (*AttributeMatcher) Match ¶
func (m *AttributeMatcher) Match(attrs map[string]interface{}) bool
type Balancer ¶
type Balancer struct {
// contains filtered or unexported fields
}
func (*Balancer) PickOutbound ¶
type BalancingRule ¶
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 ¶
func (br *BalancingRule) Build(ohm outbound.Manager) (*Balancer, error)
func (*BalancingRule) Descriptor ¶
func (*BalancingRule) Descriptor() ([]byte, []int)
func (*BalancingRule) GetOutboundSelector ¶
func (m *BalancingRule) GetOutboundSelector() []string
func (*BalancingRule) GetTag ¶
func (m *BalancingRule) GetTag() string
func (*BalancingRule) ProtoMessage ¶
func (*BalancingRule) ProtoMessage()
func (*BalancingRule) Reset ¶
func (m *BalancingRule) Reset()
func (*BalancingRule) String ¶
func (m *BalancingRule) String() string
func (*BalancingRule) XXX_DiscardUnknown ¶
func (m *BalancingRule) XXX_DiscardUnknown()
func (*BalancingRule) XXX_Marshal ¶
func (m *BalancingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BalancingRule) XXX_Merge ¶
func (m *BalancingRule) XXX_Merge(src proto.Message)
func (*BalancingRule) XXX_Size ¶
func (m *BalancingRule) XXX_Size() int
func (*BalancingRule) XXX_Unmarshal ¶
func (m *BalancingRule) XXX_Unmarshal(b []byte) error
type BalancingStrategy ¶
type CIDR ¶
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 ¶
func (*CIDR) ProtoMessage ¶
func (*CIDR) ProtoMessage()
func (*CIDR) XXX_DiscardUnknown ¶
func (m *CIDR) XXX_DiscardUnknown()
func (*CIDR) XXX_Unmarshal ¶
type ConditionChan ¶
type ConditionChan []Condition
func NewConditionChan ¶
func NewConditionChan() *ConditionChan
func (*ConditionChan) Add ¶
func (v *ConditionChan) Add(cond Condition) *ConditionChan
func (*ConditionChan) Apply ¶
func (v *ConditionChan) Apply(ctx *Context) bool
func (*ConditionChan) Len ¶
func (v *ConditionChan) Len() int
type Config ¶
type Config struct { DomainStrategy Config_DomainStrategy `` /* 153-byte string literal not displayed */ 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 ¶
func (*Config) GetBalancingRule ¶
func (m *Config) GetBalancingRule() []*BalancingRule
func (*Config) GetDomainStrategy ¶
func (m *Config) GetDomainStrategy() Config_DomainStrategy
func (*Config) GetRule ¶
func (m *Config) GetRule() []*RoutingRule
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) XXX_DiscardUnknown ¶
func (m *Config) XXX_DiscardUnknown()
func (*Config) XXX_Marshal ¶
func (*Config) XXX_Unmarshal ¶
type Config_DomainStrategy ¶
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 ¶
func (Config_DomainStrategy) EnumDescriptor() ([]byte, []int)
func (Config_DomainStrategy) String ¶
func (x Config_DomainStrategy) String() string
type Context ¶
type Context struct { Inbound *session.Inbound Outbound *session.Outbound Content *session.Content // contains filtered or unexported fields }
func (*Context) GetTargetIPs ¶
type Domain ¶
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 ¶
func (*Domain) GetAttribute ¶
func (m *Domain) GetAttribute() []*Domain_Attribute
func (*Domain) GetType ¶
func (m *Domain) GetType() Domain_Type
func (*Domain) ProtoMessage ¶
func (*Domain) ProtoMessage()
func (*Domain) XXX_DiscardUnknown ¶
func (m *Domain) XXX_DiscardUnknown()
func (*Domain) XXX_Marshal ¶
func (*Domain) XXX_Unmarshal ¶
type DomainMatcher ¶
type DomainMatcher struct {
// contains filtered or unexported fields
}
func NewDomainMatcher ¶
func NewDomainMatcher(domains []*Domain) (*DomainMatcher, error)
func (*DomainMatcher) Apply ¶
func (m *DomainMatcher) Apply(ctx *Context) bool
func (*DomainMatcher) ApplyDomain ¶
func (m *DomainMatcher) ApplyDomain(domain string) bool
type Domain_Attribute ¶
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 ¶
func (*Domain_Attribute) Descriptor() ([]byte, []int)
func (*Domain_Attribute) GetBoolValue ¶
func (m *Domain_Attribute) GetBoolValue() bool
func (*Domain_Attribute) GetIntValue ¶
func (m *Domain_Attribute) GetIntValue() int64
func (*Domain_Attribute) GetKey ¶
func (m *Domain_Attribute) GetKey() string
func (*Domain_Attribute) GetTypedValue ¶
func (m *Domain_Attribute) GetTypedValue() isDomain_Attribute_TypedValue
func (*Domain_Attribute) ProtoMessage ¶
func (*Domain_Attribute) ProtoMessage()
func (*Domain_Attribute) Reset ¶
func (m *Domain_Attribute) Reset()
func (*Domain_Attribute) String ¶
func (m *Domain_Attribute) String() string
func (*Domain_Attribute) XXX_DiscardUnknown ¶
func (m *Domain_Attribute) XXX_DiscardUnknown()
func (*Domain_Attribute) XXX_Marshal ¶
func (m *Domain_Attribute) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Domain_Attribute) XXX_Merge ¶
func (m *Domain_Attribute) XXX_Merge(src proto.Message)
func (*Domain_Attribute) XXX_OneofWrappers ¶
func (*Domain_Attribute) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*Domain_Attribute) XXX_Size ¶
func (m *Domain_Attribute) XXX_Size() int
func (*Domain_Attribute) XXX_Unmarshal ¶
func (m *Domain_Attribute) XXX_Unmarshal(b []byte) error
type Domain_Attribute_BoolValue ¶
type Domain_Attribute_BoolValue struct {
BoolValue bool `protobuf:"varint,2,opt,name=bool_value,json=boolValue,proto3,oneof"`
}
type Domain_Attribute_IntValue ¶
type Domain_Attribute_IntValue struct {
IntValue int64 `protobuf:"varint,3,opt,name=int_value,json=intValue,proto3,oneof"`
}
type Domain_Type ¶
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 ¶
func (Domain_Type) EnumDescriptor() ([]byte, []int)
func (Domain_Type) String ¶
func (x Domain_Type) String() string
type GeoIP ¶
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 ¶
func (*GeoIP) GetCountryCode ¶
func (*GeoIP) ProtoMessage ¶
func (*GeoIP) ProtoMessage()
func (*GeoIP) XXX_DiscardUnknown ¶
func (m *GeoIP) XXX_DiscardUnknown()
func (*GeoIP) XXX_Marshal ¶
func (*GeoIP) XXX_Unmarshal ¶
type GeoIPList ¶
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 ¶
func (*GeoIPList) ProtoMessage ¶
func (*GeoIPList) ProtoMessage()
func (*GeoIPList) XXX_DiscardUnknown ¶
func (m *GeoIPList) XXX_DiscardUnknown()
func (*GeoIPList) XXX_Marshal ¶
func (*GeoIPList) XXX_Unmarshal ¶
type GeoIPMatcher ¶
type GeoIPMatcher struct {
// contains filtered or unexported fields
}
func (*GeoIPMatcher) Init ¶
func (m *GeoIPMatcher) Init(cidrs []*CIDR) error
type GeoIPMatcherContainer ¶
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 ¶
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 ¶
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 ¶
func (*GeoSite) GetCountryCode ¶
func (*GeoSite) ProtoMessage ¶
func (*GeoSite) ProtoMessage()
func (*GeoSite) XXX_DiscardUnknown ¶
func (m *GeoSite) XXX_DiscardUnknown()
func (*GeoSite) XXX_Marshal ¶
func (*GeoSite) XXX_Unmarshal ¶
type GeoSiteList ¶
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 ¶
func (*GeoSiteList) Descriptor() ([]byte, []int)
func (*GeoSiteList) GetEntry ¶
func (m *GeoSiteList) GetEntry() []*GeoSite
func (*GeoSiteList) ProtoMessage ¶
func (*GeoSiteList) ProtoMessage()
func (*GeoSiteList) Reset ¶
func (m *GeoSiteList) Reset()
func (*GeoSiteList) String ¶
func (m *GeoSiteList) String() string
func (*GeoSiteList) XXX_DiscardUnknown ¶
func (m *GeoSiteList) XXX_DiscardUnknown()
func (*GeoSiteList) XXX_Marshal ¶
func (m *GeoSiteList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*GeoSiteList) XXX_Merge ¶
func (m *GeoSiteList) XXX_Merge(src proto.Message)
func (*GeoSiteList) XXX_Size ¶
func (m *GeoSiteList) XXX_Size() int
func (*GeoSiteList) XXX_Unmarshal ¶
func (m *GeoSiteList) XXX_Unmarshal(b []byte) error
type InboundTagMatcher ¶
type InboundTagMatcher struct {
// contains filtered or unexported fields
}
func NewInboundTagMatcher ¶
func NewInboundTagMatcher(tags []string) *InboundTagMatcher
func (*InboundTagMatcher) Apply ¶
func (v *InboundTagMatcher) Apply(ctx *Context) bool
type MultiGeoIPMatcher ¶
type MultiGeoIPMatcher struct {
// contains filtered or unexported fields
}
func NewMultiGeoIPMatcher ¶
func NewMultiGeoIPMatcher(geoips []*GeoIP, onSource bool) (*MultiGeoIPMatcher, error)
func (*MultiGeoIPMatcher) Apply ¶
func (m *MultiGeoIPMatcher) Apply(ctx *Context) bool
type NetworkMatcher ¶
type NetworkMatcher struct {
// contains filtered or unexported fields
}
func NewNetworkMatcher ¶
func NewNetworkMatcher(network []net.Network) NetworkMatcher
func (NetworkMatcher) Apply ¶
func (v NetworkMatcher) Apply(ctx *Context) bool
type PortMatcher ¶
type PortMatcher struct {
// contains filtered or unexported fields
}
func NewPortMatcher ¶
func NewPortMatcher(list *net.PortList) *PortMatcher
func (*PortMatcher) Apply ¶
func (v *PortMatcher) Apply(ctx *Context) bool
type ProtocolMatcher ¶
type ProtocolMatcher struct {
// contains filtered or unexported fields
}
func NewProtocolMatcher ¶
func NewProtocolMatcher(protocols []string) *ProtocolMatcher
func (*ProtocolMatcher) Apply ¶
func (m *ProtocolMatcher) Apply(ctx *Context) bool
type RandomStrategy ¶
type RandomStrategy struct { }
func (*RandomStrategy) PickOutbound ¶
func (s *RandomStrategy) PickOutbound(tags []string) string
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
Router is an implementation of routing.Router.
type RoutingRule ¶
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 ¶
func (rr *RoutingRule) BuildCondition() (Condition, error)
func (*RoutingRule) Descriptor ¶
func (*RoutingRule) Descriptor() ([]byte, []int)
func (*RoutingRule) GetAttributes ¶
func (m *RoutingRule) GetAttributes() string
func (*RoutingRule) GetBalancingTag ¶
func (m *RoutingRule) GetBalancingTag() string
func (*RoutingRule) GetCidr
deprecated
func (m *RoutingRule) GetCidr() []*CIDR
Deprecated: Do not use.
func (*RoutingRule) GetDomain ¶
func (m *RoutingRule) GetDomain() []*Domain
func (*RoutingRule) GetGeoip ¶
func (m *RoutingRule) GetGeoip() []*GeoIP
func (*RoutingRule) GetInboundTag ¶
func (m *RoutingRule) GetInboundTag() []string
func (*RoutingRule) GetNetworkList
deprecated
func (m *RoutingRule) GetNetworkList() *net.NetworkList
Deprecated: Do not use.
func (*RoutingRule) GetNetworks ¶
func (m *RoutingRule) GetNetworks() []net.Network
func (*RoutingRule) GetPortList ¶
func (m *RoutingRule) GetPortList() *net.PortList
func (*RoutingRule) GetPortRange
deprecated
func (m *RoutingRule) GetPortRange() *net.PortRange
Deprecated: Do not use.
func (*RoutingRule) GetProtocol ¶
func (m *RoutingRule) GetProtocol() []string
func (*RoutingRule) GetSourceCidr
deprecated
func (m *RoutingRule) GetSourceCidr() []*CIDR
Deprecated: Do not use.
func (*RoutingRule) GetSourceGeoip ¶
func (m *RoutingRule) GetSourceGeoip() []*GeoIP
func (*RoutingRule) GetTag ¶
func (m *RoutingRule) GetTag() string
func (*RoutingRule) GetTargetTag ¶
func (m *RoutingRule) GetTargetTag() isRoutingRule_TargetTag
func (*RoutingRule) GetUserEmail ¶
func (m *RoutingRule) GetUserEmail() []string
func (*RoutingRule) ProtoMessage ¶
func (*RoutingRule) ProtoMessage()
func (*RoutingRule) Reset ¶
func (m *RoutingRule) Reset()
func (*RoutingRule) String ¶
func (m *RoutingRule) String() string
func (*RoutingRule) XXX_DiscardUnknown ¶
func (m *RoutingRule) XXX_DiscardUnknown()
func (*RoutingRule) XXX_Marshal ¶
func (m *RoutingRule) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RoutingRule) XXX_Merge ¶
func (m *RoutingRule) XXX_Merge(src proto.Message)
func (*RoutingRule) XXX_OneofWrappers ¶
func (*RoutingRule) XXX_OneofWrappers() []interface{}
XXX_OneofWrappers is for the internal use of the proto package.
func (*RoutingRule) XXX_Size ¶
func (m *RoutingRule) XXX_Size() int
func (*RoutingRule) XXX_Unmarshal ¶
func (m *RoutingRule) XXX_Unmarshal(b []byte) error
type RoutingRule_BalancingTag ¶
type RoutingRule_BalancingTag struct {
BalancingTag string `protobuf:"bytes,12,opt,name=balancing_tag,json=balancingTag,proto3,oneof"`
}
type RoutingRule_Tag ¶
type RoutingRule_Tag struct {
Tag string `protobuf:"bytes,1,opt,name=tag,proto3,oneof"`
}
type UserMatcher ¶
type UserMatcher struct {
// contains filtered or unexported fields
}
func NewUserMatcher ¶
func NewUserMatcher(users []string) *UserMatcher
func (*UserMatcher) Apply ¶
func (v *UserMatcher) Apply(ctx *Context) bool
Click to show internal directories.
Click to hide internal directories.