Documentation ¶
Index ¶
- Variables
- func NewDNSRule(router adapter.Router, logger log.ContextLogger, options option.DNSRule, ...) (adapter.DNSRule, error)
- func NewHeadlessRule(router adapter.Router, options option.HeadlessRule) (adapter.HeadlessRule, error)
- func NewRule(router adapter.Router, logger log.ContextLogger, options option.Rule, ...) (adapter.Rule, error)
- func NewRuleSet(ctx context.Context, router adapter.Router, logger logger.ContextLogger, ...) (adapter.RuleSet, error)
- type AdGuardDomainItem
- type AuthUserItem
- type ClashModeItem
- type ClientItem
- type DNSReverseMapping
- type DefaultDNSRule
- func (r *DefaultDNSRule) ClientSubnet() *netip.Prefix
- func (r *DefaultDNSRule) Close() error
- func (r *DefaultDNSRule) DisableCache() bool
- func (r *DefaultDNSRule) Match(metadata *adapter.InboundContext) bool
- func (r *DefaultDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
- func (r *DefaultDNSRule) Outbound() string
- func (r *DefaultDNSRule) RewriteTTL() *uint32
- func (r *DefaultDNSRule) Start() error
- func (r *DefaultDNSRule) String() string
- func (r *DefaultDNSRule) Type() string
- func (r *DefaultDNSRule) UpdateGeosite() error
- func (r *DefaultDNSRule) WithAddressLimit() bool
- type DefaultHeadlessRule
- func (r *DefaultHeadlessRule) Close() error
- func (r *DefaultHeadlessRule) Match(metadata *adapter.InboundContext) bool
- func (r *DefaultHeadlessRule) Outbound() string
- func (r *DefaultHeadlessRule) Start() error
- func (r *DefaultHeadlessRule) String() string
- func (r *DefaultHeadlessRule) Type() string
- func (r *DefaultHeadlessRule) UpdateGeosite() error
- type DefaultRule
- type DomainItem
- type DomainKeywordItem
- type DomainRegexItem
- type GeoIPItem
- type GeositeItem
- type IPCIDRItem
- type IPIsPrivateItem
- type IPVersionItem
- type InboundItem
- type LocalRuleSet
- func (s *LocalRuleSet) Cleanup()
- func (s *LocalRuleSet) Close() error
- func (s *LocalRuleSet) DecRef()
- func (s *LocalRuleSet) ExtractIPSet() []*netipx.IPSet
- func (s *LocalRuleSet) IncRef()
- func (s *LocalRuleSet) Match(metadata *adapter.InboundContext) bool
- func (s *LocalRuleSet) Metadata() adapter.RuleSetMetadata
- func (s *LocalRuleSet) Name() string
- func (s *LocalRuleSet) PostStart() error
- func (s *LocalRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
- func (s *LocalRuleSet) StartContext(ctx context.Context, startContext adapter.RuleSetStartContext) error
- func (s *LocalRuleSet) String() string
- func (s *LocalRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
- type LogicalDNSRule
- func (r *LogicalDNSRule) ClientSubnet() *netip.Prefix
- func (r *LogicalDNSRule) Close() error
- func (r *LogicalDNSRule) DisableCache() bool
- func (r *LogicalDNSRule) Match(metadata *adapter.InboundContext) bool
- func (r *LogicalDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
- func (r *LogicalDNSRule) Outbound() string
- func (r *LogicalDNSRule) RewriteTTL() *uint32
- func (r *LogicalDNSRule) Start() error
- func (r *LogicalDNSRule) String() string
- func (r *LogicalDNSRule) Type() string
- func (r *LogicalDNSRule) UpdateGeosite() error
- func (r *LogicalDNSRule) WithAddressLimit() bool
- type LogicalHeadlessRule
- func (r *LogicalHeadlessRule) Close() error
- func (r *LogicalHeadlessRule) Match(metadata *adapter.InboundContext) bool
- func (r *LogicalHeadlessRule) Outbound() string
- func (r *LogicalHeadlessRule) Start() error
- func (r *LogicalHeadlessRule) String() string
- func (r *LogicalHeadlessRule) Type() string
- func (r *LogicalHeadlessRule) UpdateGeosite() error
- type LogicalRule
- type NetworkItem
- type OutboundItem
- type PackageNameItem
- type PortItem
- type PortRangeItem
- type ProcessItem
- type ProcessPathItem
- type ProtocolItem
- type QueryTypeItem
- type RemoteRuleSet
- func (s *RemoteRuleSet) Cleanup()
- func (s *RemoteRuleSet) Close() error
- func (s *RemoteRuleSet) DecRef()
- func (s *RemoteRuleSet) ExtractIPSet() []*netipx.IPSet
- func (s *RemoteRuleSet) IncRef()
- func (s *RemoteRuleSet) Match(metadata *adapter.InboundContext) bool
- func (s *RemoteRuleSet) Metadata() adapter.RuleSetMetadata
- func (s *RemoteRuleSet) Name() string
- func (s *RemoteRuleSet) PostStart() error
- func (s *RemoteRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
- func (s *RemoteRuleSet) StartContext(ctx context.Context, startContext adapter.RuleSetStartContext) error
- func (s *RemoteRuleSet) String() string
- func (s *RemoteRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
- type Router
- func (r *Router) AutoDetectInterface() bool
- func (r *Router) AutoDetectInterfaceFunc() control.Func
- func (r *Router) AutoRedirectOutputMark() uint32
- func (r *Router) ClashServer() adapter.ClashServer
- func (r *Router) Cleanup() error
- func (r *Router) ClearDNSCache()
- func (r *Router) Close() error
- func (r *Router) DefaultInterface() string
- func (r *Router) DefaultMark() uint32
- func (r *Router) DefaultOutbound(network string) (adapter.Outbound, error)
- func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error)
- func (r *Router) FakeIPStore() adapter.FakeIPStore
- func (r *Router) GeoIPReader() *geoip.Reader
- func (r *Router) Initialize(inbounds []adapter.Inbound, outbounds []adapter.Outbound, ...) error
- func (r *Router) InterfaceFinder() control.InterfaceFinder
- func (r *Router) InterfaceMonitor() tun.DefaultInterfaceMonitor
- func (r *Router) LoadGeosite(code string) (adapter.Rule, error)
- func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error)
- func (r *Router) LookupDefault(ctx context.Context, domain string) ([]netip.Addr, error)
- func (r *Router) NeedWIFIState() bool
- func (r *Router) NetworkMonitor() tun.NetworkUpdateMonitor
- func (r *Router) NewError(ctx context.Context, err error)
- func (r *Router) OnPackagesUpdated(packages int, sharedUsers int)
- func (r *Router) Outbound(tag string) (adapter.Outbound, bool)
- func (r *Router) Outbounds() []adapter.Outbound
- func (r *Router) PackageManager() tun.PackageManager
- func (r *Router) PostStart() error
- func (r *Router) PreStart() error
- func (r *Router) RegisterAutoRedirectOutputMark(mark uint32) error
- func (r *Router) ResetNetwork() error
- func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error
- func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error
- func (r *Router) RuleSet(tag string) (adapter.RuleSet, bool)
- func (r *Router) Rules() []adapter.Rule
- func (r *Router) SetClashServer(server adapter.ClashServer)
- func (r *Router) SetV2RayServer(server adapter.V2RayServer)
- func (r *Router) Start() error
- func (r *Router) UpdateInterfaces() error
- func (r *Router) V2RayServer() adapter.V2RayServer
- func (r *Router) WIFIState() adapter.WIFIState
- type RuleItem
- type RuleSetItem
- type RuleSetStartContext
- type UserIdItem
- type UserItem
- type WIFIBSSIDItem
- type WIFISSIDItem
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrBadPortRange = E.New("bad port range")
Functions ¶
func NewDNSRule ¶
func NewHeadlessRule ¶ added in v1.8.0
func NewHeadlessRule(router adapter.Router, options option.HeadlessRule) (adapter.HeadlessRule, error)
Types ¶
type AdGuardDomainItem ¶ added in v1.10.0
type AdGuardDomainItem struct {
// contains filtered or unexported fields
}
func NewAdGuardDomainItem ¶ added in v1.10.0
func NewAdGuardDomainItem(ruleLines []string) *AdGuardDomainItem
func NewRawAdGuardDomainItem ¶ added in v1.10.0
func NewRawAdGuardDomainItem(matcher *domain.AdGuardMatcher) *AdGuardDomainItem
func (*AdGuardDomainItem) Match ¶ added in v1.10.0
func (r *AdGuardDomainItem) Match(metadata *adapter.InboundContext) bool
func (*AdGuardDomainItem) String ¶ added in v1.10.0
func (r *AdGuardDomainItem) String() string
type AuthUserItem ¶
type AuthUserItem struct {
// contains filtered or unexported fields
}
func NewAuthUserItem ¶
func NewAuthUserItem(users []string) *AuthUserItem
func (*AuthUserItem) Match ¶
func (r *AuthUserItem) Match(metadata *adapter.InboundContext) bool
func (*AuthUserItem) String ¶
func (r *AuthUserItem) String() string
type ClashModeItem ¶ added in v1.1.0
type ClashModeItem struct {
// contains filtered or unexported fields
}
func NewClashModeItem ¶ added in v1.1.0
func NewClashModeItem(router adapter.Router, mode string) *ClashModeItem
func (*ClashModeItem) Match ¶ added in v1.1.0
func (r *ClashModeItem) Match(metadata *adapter.InboundContext) bool
func (*ClashModeItem) String ¶ added in v1.1.0
func (r *ClashModeItem) String() string
type ClientItem ¶ added in v1.10.0
type ClientItem struct {
// contains filtered or unexported fields
}
func NewClientItem ¶ added in v1.10.0
func NewClientItem(clients []string) *ClientItem
func (*ClientItem) Match ¶ added in v1.10.0
func (r *ClientItem) Match(metadata *adapter.InboundContext) bool
func (*ClientItem) String ¶ added in v1.10.0
func (r *ClientItem) String() string
type DNSReverseMapping ¶ added in v1.3.0
type DNSReverseMapping struct {
// contains filtered or unexported fields
}
func NewDNSReverseMapping ¶ added in v1.3.0
func NewDNSReverseMapping() *DNSReverseMapping
type DefaultDNSRule ¶
type DefaultDNSRule struct {
// contains filtered or unexported fields
}
func NewDefaultDNSRule ¶
func NewDefaultDNSRule(router adapter.Router, logger log.ContextLogger, options option.DefaultDNSRule) (*DefaultDNSRule, error)
func (*DefaultDNSRule) ClientSubnet ¶ added in v1.8.12
func (r *DefaultDNSRule) ClientSubnet() *netip.Prefix
func (*DefaultDNSRule) DisableCache ¶
func (r *DefaultDNSRule) DisableCache() bool
func (*DefaultDNSRule) Match ¶
func (r *DefaultDNSRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultDNSRule) MatchAddressLimit ¶ added in v1.8.12
func (r *DefaultDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
func (*DefaultDNSRule) RewriteTTL ¶ added in v1.3.0
func (r *DefaultDNSRule) RewriteTTL() *uint32
func (*DefaultDNSRule) UpdateGeosite ¶
func (r *DefaultDNSRule) UpdateGeosite() error
func (*DefaultDNSRule) WithAddressLimit ¶ added in v1.8.12
func (r *DefaultDNSRule) WithAddressLimit() bool
type DefaultHeadlessRule ¶ added in v1.8.0
type DefaultHeadlessRule struct {
// contains filtered or unexported fields
}
func NewDefaultHeadlessRule ¶ added in v1.8.0
func NewDefaultHeadlessRule(router adapter.Router, options option.DefaultHeadlessRule) (*DefaultHeadlessRule, error)
func (*DefaultHeadlessRule) Match ¶ added in v1.8.0
func (r *DefaultHeadlessRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultHeadlessRule) Outbound ¶ added in v1.8.0
func (r *DefaultHeadlessRule) Outbound() string
func (*DefaultHeadlessRule) UpdateGeosite ¶ added in v1.8.0
func (r *DefaultHeadlessRule) UpdateGeosite() error
type DefaultRule ¶
type DefaultRule struct {
// contains filtered or unexported fields
}
func NewDefaultRule ¶
func NewDefaultRule(router adapter.Router, logger log.ContextLogger, options option.DefaultRule) (*DefaultRule, error)
func (*DefaultRule) Match ¶
func (r *DefaultRule) Match(metadata *adapter.InboundContext) bool
func (*DefaultRule) UpdateGeosite ¶
func (r *DefaultRule) UpdateGeosite() error
type DomainItem ¶
type DomainItem struct {
// contains filtered or unexported fields
}
func NewDomainItem ¶
func NewDomainItem(domains []string, domainSuffixes []string) *DomainItem
func NewRawDomainItem ¶ added in v1.8.0
func NewRawDomainItem(matcher *domain.Matcher) *DomainItem
func (*DomainItem) Match ¶
func (r *DomainItem) Match(metadata *adapter.InboundContext) bool
func (*DomainItem) String ¶
func (r *DomainItem) String() string
type DomainKeywordItem ¶
type DomainKeywordItem struct {
// contains filtered or unexported fields
}
func NewDomainKeywordItem ¶
func NewDomainKeywordItem(keywords []string) *DomainKeywordItem
func (*DomainKeywordItem) Match ¶
func (r *DomainKeywordItem) Match(metadata *adapter.InboundContext) bool
func (*DomainKeywordItem) String ¶
func (r *DomainKeywordItem) String() string
type DomainRegexItem ¶
type DomainRegexItem struct {
// contains filtered or unexported fields
}
func NewDomainRegexItem ¶
func NewDomainRegexItem(expressions []string) (*DomainRegexItem, error)
func (*DomainRegexItem) Match ¶
func (r *DomainRegexItem) Match(metadata *adapter.InboundContext) bool
func (*DomainRegexItem) String ¶
func (r *DomainRegexItem) String() string
type GeoIPItem ¶
type GeoIPItem struct {
// contains filtered or unexported fields
}
func NewGeoIPItem ¶
type GeositeItem ¶
type GeositeItem struct {
// contains filtered or unexported fields
}
func NewGeositeItem ¶
func NewGeositeItem(router adapter.Router, logger log.ContextLogger, codes []string) *GeositeItem
func (*GeositeItem) Match ¶
func (r *GeositeItem) Match(metadata *adapter.InboundContext) bool
func (*GeositeItem) String ¶
func (r *GeositeItem) String() string
func (*GeositeItem) Update ¶
func (r *GeositeItem) Update() error
type IPCIDRItem ¶
type IPCIDRItem struct {
// contains filtered or unexported fields
}
func NewIPCIDRItem ¶
func NewIPCIDRItem(isSource bool, prefixStrings []string) (*IPCIDRItem, error)
func NewRawIPCIDRItem ¶ added in v1.8.0
func NewRawIPCIDRItem(isSource bool, ipSet *netipx.IPSet) *IPCIDRItem
func (*IPCIDRItem) Match ¶
func (r *IPCIDRItem) Match(metadata *adapter.InboundContext) bool
func (*IPCIDRItem) String ¶
func (r *IPCIDRItem) String() string
type IPIsPrivateItem ¶ added in v1.8.0
type IPIsPrivateItem struct {
// contains filtered or unexported fields
}
func NewIPIsPrivateItem ¶ added in v1.8.0
func NewIPIsPrivateItem(isSource bool) *IPIsPrivateItem
func (*IPIsPrivateItem) Match ¶ added in v1.8.0
func (r *IPIsPrivateItem) Match(metadata *adapter.InboundContext) bool
func (*IPIsPrivateItem) String ¶ added in v1.8.0
func (r *IPIsPrivateItem) String() string
type IPVersionItem ¶
type IPVersionItem struct {
// contains filtered or unexported fields
}
func NewIPVersionItem ¶
func NewIPVersionItem(isIPv6 bool) *IPVersionItem
func (*IPVersionItem) Match ¶
func (r *IPVersionItem) Match(metadata *adapter.InboundContext) bool
func (*IPVersionItem) String ¶
func (r *IPVersionItem) String() string
type InboundItem ¶
type InboundItem struct {
// contains filtered or unexported fields
}
func NewInboundRule ¶
func NewInboundRule(inbounds []string) *InboundItem
func (*InboundItem) Match ¶
func (r *InboundItem) Match(metadata *adapter.InboundContext) bool
func (*InboundItem) String ¶
func (r *InboundItem) String() string
type LocalRuleSet ¶ added in v1.8.0
type LocalRuleSet struct {
// contains filtered or unexported fields
}
func NewLocalRuleSet ¶ added in v1.8.0
func (*LocalRuleSet) Cleanup ¶ added in v1.10.0
func (s *LocalRuleSet) Cleanup()
func (*LocalRuleSet) Close ¶ added in v1.8.0
func (s *LocalRuleSet) Close() error
func (*LocalRuleSet) DecRef ¶ added in v1.10.0
func (s *LocalRuleSet) DecRef()
func (*LocalRuleSet) ExtractIPSet ¶ added in v1.10.0
func (s *LocalRuleSet) ExtractIPSet() []*netipx.IPSet
func (*LocalRuleSet) IncRef ¶ added in v1.10.0
func (s *LocalRuleSet) IncRef()
func (*LocalRuleSet) Match ¶ added in v1.8.0
func (s *LocalRuleSet) Match(metadata *adapter.InboundContext) bool
func (*LocalRuleSet) Metadata ¶ added in v1.8.0
func (s *LocalRuleSet) Metadata() adapter.RuleSetMetadata
func (*LocalRuleSet) Name ¶ added in v1.10.0
func (s *LocalRuleSet) Name() string
func (*LocalRuleSet) PostStart ¶ added in v1.8.0
func (s *LocalRuleSet) PostStart() error
func (*LocalRuleSet) RegisterCallback ¶ added in v1.10.0
func (s *LocalRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
func (*LocalRuleSet) StartContext ¶ added in v1.8.0
func (s *LocalRuleSet) StartContext(ctx context.Context, startContext adapter.RuleSetStartContext) error
func (*LocalRuleSet) String ¶ added in v1.8.12
func (s *LocalRuleSet) String() string
func (*LocalRuleSet) UnregisterCallback ¶ added in v1.10.0
func (s *LocalRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
type LogicalDNSRule ¶
type LogicalDNSRule struct {
// contains filtered or unexported fields
}
func NewLogicalDNSRule ¶
func NewLogicalDNSRule(router adapter.Router, logger log.ContextLogger, options option.LogicalDNSRule) (*LogicalDNSRule, error)
func (*LogicalDNSRule) ClientSubnet ¶ added in v1.8.12
func (r *LogicalDNSRule) ClientSubnet() *netip.Prefix
func (*LogicalDNSRule) DisableCache ¶
func (r *LogicalDNSRule) DisableCache() bool
func (*LogicalDNSRule) Match ¶
func (r *LogicalDNSRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalDNSRule) MatchAddressLimit ¶ added in v1.8.12
func (r *LogicalDNSRule) MatchAddressLimit(metadata *adapter.InboundContext) bool
func (*LogicalDNSRule) RewriteTTL ¶ added in v1.3.0
func (r *LogicalDNSRule) RewriteTTL() *uint32
func (*LogicalDNSRule) UpdateGeosite ¶
func (r *LogicalDNSRule) UpdateGeosite() error
func (*LogicalDNSRule) WithAddressLimit ¶ added in v1.8.12
func (r *LogicalDNSRule) WithAddressLimit() bool
type LogicalHeadlessRule ¶ added in v1.8.0
type LogicalHeadlessRule struct {
// contains filtered or unexported fields
}
func NewLogicalHeadlessRule ¶ added in v1.8.0
func NewLogicalHeadlessRule(router adapter.Router, options option.LogicalHeadlessRule) (*LogicalHeadlessRule, error)
func (*LogicalHeadlessRule) Match ¶ added in v1.8.0
func (r *LogicalHeadlessRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalHeadlessRule) Outbound ¶ added in v1.8.0
func (r *LogicalHeadlessRule) Outbound() string
func (*LogicalHeadlessRule) UpdateGeosite ¶ added in v1.8.0
func (r *LogicalHeadlessRule) UpdateGeosite() error
type LogicalRule ¶
type LogicalRule struct {
// contains filtered or unexported fields
}
func NewLogicalRule ¶
func NewLogicalRule(router adapter.Router, logger log.ContextLogger, options option.LogicalRule) (*LogicalRule, error)
func (*LogicalRule) Match ¶
func (r *LogicalRule) Match(metadata *adapter.InboundContext) bool
func (*LogicalRule) UpdateGeosite ¶
func (r *LogicalRule) UpdateGeosite() error
type NetworkItem ¶
type NetworkItem struct {
// contains filtered or unexported fields
}
func NewNetworkItem ¶
func NewNetworkItem(networks []string) *NetworkItem
func (*NetworkItem) Match ¶
func (r *NetworkItem) Match(metadata *adapter.InboundContext) bool
func (*NetworkItem) String ¶
func (r *NetworkItem) String() string
type OutboundItem ¶
type OutboundItem struct {
// contains filtered or unexported fields
}
func NewOutboundRule ¶
func NewOutboundRule(outbounds []string) *OutboundItem
func (*OutboundItem) Match ¶
func (r *OutboundItem) Match(metadata *adapter.InboundContext) bool
func (*OutboundItem) String ¶
func (r *OutboundItem) String() string
type PackageNameItem ¶
type PackageNameItem struct {
// contains filtered or unexported fields
}
func NewPackageNameItem ¶
func NewPackageNameItem(packageNameList []string) *PackageNameItem
func (*PackageNameItem) Match ¶
func (r *PackageNameItem) Match(metadata *adapter.InboundContext) bool
func (*PackageNameItem) String ¶
func (r *PackageNameItem) String() string
type PortItem ¶
type PortItem struct {
// contains filtered or unexported fields
}
func NewPortItem ¶
type PortRangeItem ¶
type PortRangeItem struct {
// contains filtered or unexported fields
}
func NewPortRangeItem ¶
func NewPortRangeItem(isSource bool, rangeList []string) (*PortRangeItem, error)
func (*PortRangeItem) Match ¶
func (r *PortRangeItem) Match(metadata *adapter.InboundContext) bool
func (*PortRangeItem) String ¶
func (r *PortRangeItem) String() string
type ProcessItem ¶
type ProcessItem struct {
// contains filtered or unexported fields
}
func NewProcessItem ¶
func NewProcessItem(processNameList []string) *ProcessItem
func (*ProcessItem) Match ¶
func (r *ProcessItem) Match(metadata *adapter.InboundContext) bool
func (*ProcessItem) String ¶
func (r *ProcessItem) String() string
type ProcessPathItem ¶ added in v1.0.1
type ProcessPathItem struct {
// contains filtered or unexported fields
}
func NewProcessPathItem ¶ added in v1.0.1
func NewProcessPathItem(processNameList []string) *ProcessPathItem
func (*ProcessPathItem) Match ¶ added in v1.0.1
func (r *ProcessPathItem) Match(metadata *adapter.InboundContext) bool
func (*ProcessPathItem) String ¶ added in v1.0.1
func (r *ProcessPathItem) String() string
type ProtocolItem ¶
type ProtocolItem struct {
// contains filtered or unexported fields
}
func NewProtocolItem ¶
func NewProtocolItem(protocols []string) *ProtocolItem
func (*ProtocolItem) Match ¶
func (r *ProtocolItem) Match(metadata *adapter.InboundContext) bool
func (*ProtocolItem) String ¶
func (r *ProtocolItem) String() string
type QueryTypeItem ¶ added in v1.2.0
type QueryTypeItem struct {
// contains filtered or unexported fields
}
func NewQueryTypeItem ¶ added in v1.2.0
func NewQueryTypeItem(typeList []option.DNSQueryType) *QueryTypeItem
func (*QueryTypeItem) Match ¶ added in v1.2.0
func (r *QueryTypeItem) Match(metadata *adapter.InboundContext) bool
func (*QueryTypeItem) String ¶ added in v1.2.0
func (r *QueryTypeItem) String() string
type RemoteRuleSet ¶ added in v1.8.0
type RemoteRuleSet struct {
// contains filtered or unexported fields
}
func NewRemoteRuleSet ¶ added in v1.8.0
func NewRemoteRuleSet(ctx context.Context, router adapter.Router, logger logger.ContextLogger, options option.RuleSet) *RemoteRuleSet
func (*RemoteRuleSet) Cleanup ¶ added in v1.10.0
func (s *RemoteRuleSet) Cleanup()
func (*RemoteRuleSet) Close ¶ added in v1.8.0
func (s *RemoteRuleSet) Close() error
func (*RemoteRuleSet) DecRef ¶ added in v1.10.0
func (s *RemoteRuleSet) DecRef()
func (*RemoteRuleSet) ExtractIPSet ¶ added in v1.10.0
func (s *RemoteRuleSet) ExtractIPSet() []*netipx.IPSet
func (*RemoteRuleSet) IncRef ¶ added in v1.10.0
func (s *RemoteRuleSet) IncRef()
func (*RemoteRuleSet) Match ¶ added in v1.8.0
func (s *RemoteRuleSet) Match(metadata *adapter.InboundContext) bool
func (*RemoteRuleSet) Metadata ¶ added in v1.8.0
func (s *RemoteRuleSet) Metadata() adapter.RuleSetMetadata
func (*RemoteRuleSet) Name ¶ added in v1.10.0
func (s *RemoteRuleSet) Name() string
func (*RemoteRuleSet) PostStart ¶ added in v1.8.0
func (s *RemoteRuleSet) PostStart() error
func (*RemoteRuleSet) RegisterCallback ¶ added in v1.10.0
func (s *RemoteRuleSet) RegisterCallback(callback adapter.RuleSetUpdateCallback) *list.Element[adapter.RuleSetUpdateCallback]
func (*RemoteRuleSet) StartContext ¶ added in v1.8.0
func (s *RemoteRuleSet) StartContext(ctx context.Context, startContext adapter.RuleSetStartContext) error
func (*RemoteRuleSet) String ¶ added in v1.8.12
func (s *RemoteRuleSet) String() string
func (*RemoteRuleSet) UnregisterCallback ¶ added in v1.10.0
func (s *RemoteRuleSet) UnregisterCallback(element *list.Element[adapter.RuleSetUpdateCallback])
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) AutoDetectInterface ¶
func (*Router) AutoDetectInterfaceFunc ¶ added in v1.2.0
func (*Router) AutoRedirectOutputMark ¶ added in v1.10.0
func (*Router) ClashServer ¶ added in v1.1.0
func (r *Router) ClashServer() adapter.ClashServer
func (*Router) ClearDNSCache ¶ added in v1.4.0
func (r *Router) ClearDNSCache()
func (*Router) DefaultInterface ¶
func (*Router) DefaultMark ¶
func (*Router) DefaultOutbound ¶
func (*Router) FakeIPStore ¶ added in v1.3.0
func (r *Router) FakeIPStore() adapter.FakeIPStore
func (*Router) GeoIPReader ¶
func (*Router) Initialize ¶
func (*Router) InterfaceFinder ¶ added in v1.1.0
func (r *Router) InterfaceFinder() control.InterfaceFinder
func (*Router) InterfaceMonitor ¶
func (r *Router) InterfaceMonitor() tun.DefaultInterfaceMonitor
func (*Router) LookupDefault ¶
func (*Router) NeedWIFIState ¶ added in v1.8.6
func (*Router) NetworkMonitor ¶
func (r *Router) NetworkMonitor() tun.NetworkUpdateMonitor
func (*Router) OnPackagesUpdated ¶ added in v1.0.1
func (*Router) PackageManager ¶ added in v1.0.1
func (r *Router) PackageManager() tun.PackageManager
func (*Router) RegisterAutoRedirectOutputMark ¶ added in v1.10.0
func (*Router) ResetNetwork ¶ added in v1.3.0
func (*Router) RouteConnection ¶
func (*Router) RoutePacketConnection ¶
func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error
func (*Router) SetClashServer ¶ added in v1.1.0
func (r *Router) SetClashServer(server adapter.ClashServer)
func (*Router) SetV2RayServer ¶ added in v1.1.0
func (r *Router) SetV2RayServer(server adapter.V2RayServer)
func (*Router) UpdateInterfaces ¶ added in v1.2.5
func (*Router) V2RayServer ¶ added in v1.1.0
func (r *Router) V2RayServer() adapter.V2RayServer
type RuleItem ¶
type RuleItem interface { Match(metadata *adapter.InboundContext) bool String() string }
type RuleSetItem ¶ added in v1.8.0
type RuleSetItem struct {
// contains filtered or unexported fields
}
func NewRuleSetItem ¶ added in v1.8.0
func (*RuleSetItem) ContainsDestinationIPCIDRRule ¶ added in v1.8.12
func (r *RuleSetItem) ContainsDestinationIPCIDRRule() bool
func (*RuleSetItem) Match ¶ added in v1.8.0
func (r *RuleSetItem) Match(metadata *adapter.InboundContext) bool
func (*RuleSetItem) Start ¶ added in v1.8.0
func (r *RuleSetItem) Start() error
func (*RuleSetItem) String ¶ added in v1.8.0
func (r *RuleSetItem) String() string
type RuleSetStartContext ¶ added in v1.8.0
type RuleSetStartContext struct {
// contains filtered or unexported fields
}
func NewRuleSetStartContext ¶ added in v1.8.0
func NewRuleSetStartContext() *RuleSetStartContext
func (*RuleSetStartContext) Close ¶ added in v1.8.0
func (c *RuleSetStartContext) Close()
func (*RuleSetStartContext) HTTPClient ¶ added in v1.8.0
type UserIdItem ¶
type UserIdItem struct {
// contains filtered or unexported fields
}
func NewUserIDItem ¶
func NewUserIDItem(userIdList []int32) *UserIdItem
func (*UserIdItem) Match ¶
func (r *UserIdItem) Match(metadata *adapter.InboundContext) bool
func (*UserIdItem) String ¶
func (r *UserIdItem) String() string
type UserItem ¶
type UserItem struct {
// contains filtered or unexported fields
}
func NewUserItem ¶
type WIFIBSSIDItem ¶ added in v1.7.0
type WIFIBSSIDItem struct {
// contains filtered or unexported fields
}
func NewWIFIBSSIDItem ¶ added in v1.7.0
func NewWIFIBSSIDItem(router adapter.Router, bssidList []string) *WIFIBSSIDItem
func (*WIFIBSSIDItem) Match ¶ added in v1.7.0
func (r *WIFIBSSIDItem) Match(metadata *adapter.InboundContext) bool
func (*WIFIBSSIDItem) String ¶ added in v1.7.0
func (r *WIFIBSSIDItem) String() string
type WIFISSIDItem ¶ added in v1.7.0
type WIFISSIDItem struct {
// contains filtered or unexported fields
}
func NewWIFISSIDItem ¶ added in v1.7.0
func NewWIFISSIDItem(router adapter.Router, ssidList []string) *WIFISSIDItem
func (*WIFISSIDItem) Match ¶ added in v1.7.0
func (r *WIFISSIDItem) Match(metadata *adapter.InboundContext) bool
func (*WIFISSIDItem) String ¶ added in v1.7.0
func (r *WIFISSIDItem) String() string
Source Files ¶
- router.go
- router_dns.go
- router_geo_resources.go
- router_rule.go
- rule_abstract.go
- rule_default.go
- rule_dns.go
- rule_headless.go
- rule_item_adguard.go
- rule_item_auth_user.go
- rule_item_cidr.go
- rule_item_clash_mode.go
- rule_item_client.go
- rule_item_domain.go
- rule_item_domain_keyword.go
- rule_item_domain_regex.go
- rule_item_geoip.go
- rule_item_geosite.go
- rule_item_inbound.go
- rule_item_ip_is_private.go
- rule_item_ipversion.go
- rule_item_network.go
- rule_item_outbound.go
- rule_item_package_name.go
- rule_item_port.go
- rule_item_port_range.go
- rule_item_process_name.go
- rule_item_process_path.go
- rule_item_protocol.go
- rule_item_query_type.go
- rule_item_rule_set.go
- rule_item_user.go
- rule_item_user_id.go
- rule_item_wifi_bssid.go
- rule_item_wifi_ssid.go
- rule_set.go
- rule_set_local.go
- rule_set_remote.go
Click to show internal directories.
Click to hide internal directories.