route

package
v1.11.0-alpha.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2024 License: GPL-2.0 Imports: 55 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExchangeDNSPacket

func ExchangeDNSPacket(ctx context.Context, router *Router, conn N.PacketConn, buffer *buf.Buffer, metadata adapter.InboundContext, destination M.Socksaddr)

Types

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

func (*DNSReverseMapping) Query added in v1.3.0

func (m *DNSReverseMapping) Query(address netip.Addr) (string, bool)

func (*DNSReverseMapping) Save added in v1.3.0

func (m *DNSReverseMapping) Save(address netip.Addr, domain string, ttl int)

type Router

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

func NewRouter

func NewRouter(
	ctx context.Context,
	logFactory log.Factory,
	options option.RouteOptions,
	dnsOptions option.DNSOptions,
	ntpOptions option.NTPOptions,
	inbounds []option.Inbound,
) (*Router, error)

func (*Router) AutoDetectInterface

func (r *Router) AutoDetectInterface() bool

func (*Router) AutoDetectInterfaceFunc added in v1.2.0

func (r *Router) AutoDetectInterfaceFunc() control.Func

func (*Router) AutoRedirectOutputMark added in v1.10.0

func (r *Router) AutoRedirectOutputMark() uint32

func (*Router) ClashServer added in v1.1.0

func (r *Router) ClashServer() adapter.ClashServer

func (*Router) Cleanup added in v1.10.0

func (r *Router) Cleanup() error

func (*Router) ClearDNSCache added in v1.4.0

func (r *Router) ClearDNSCache()

func (*Router) Close

func (r *Router) Close() error

func (*Router) DefaultInterface

func (r *Router) DefaultInterface() string

func (*Router) DefaultMark

func (r *Router) DefaultMark() uint32

func (*Router) DefaultOutbound

func (r *Router) DefaultOutbound(network string) (adapter.Outbound, error)

func (*Router) Exchange

func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg) (*mDNS.Msg, error)

func (*Router) FakeIPStore added in v1.3.0

func (r *Router) FakeIPStore() adapter.FakeIPStore

func (*Router) GeoIPReader

func (r *Router) GeoIPReader() *geoip.Reader

func (*Router) Initialize

func (r *Router) Initialize(inbounds []adapter.Inbound, outbounds []adapter.Outbound, defaultOutbound func() adapter.Outbound) error

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) LoadGeosite

func (r *Router) LoadGeosite(code string) (adapter.Rule, error)

func (*Router) Lookup

func (r *Router) Lookup(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error)

func (*Router) LookupDefault

func (r *Router) LookupDefault(ctx context.Context, domain string) ([]netip.Addr, error)

func (*Router) NeedWIFIState added in v1.8.6

func (r *Router) NeedWIFIState() bool

func (*Router) NetworkMonitor

func (r *Router) NetworkMonitor() tun.NetworkUpdateMonitor

func (*Router) NewError

func (r *Router) NewError(ctx context.Context, err error)

func (*Router) OnPackagesUpdated added in v1.0.1

func (r *Router) OnPackagesUpdated(packages int, sharedUsers int)

func (*Router) Outbound

func (r *Router) Outbound(tag string) (adapter.Outbound, bool)

func (*Router) Outbounds

func (r *Router) Outbounds() []adapter.Outbound

func (*Router) PackageManager added in v1.0.1

func (r *Router) PackageManager() tun.PackageManager

func (*Router) PostStart added in v1.7.2

func (r *Router) PostStart() error

func (*Router) PreMatch

func (r *Router) PreMatch(metadata adapter.InboundContext) error

func (*Router) PreStart added in v1.8.0

func (r *Router) PreStart() error

func (*Router) RegisterAutoRedirectOutputMark added in v1.10.0

func (r *Router) RegisterAutoRedirectOutputMark(mark uint32) error

func (*Router) ResetNetwork added in v1.3.0

func (r *Router) ResetNetwork() error

func (*Router) RouteConnection deprecated

func (r *Router) RouteConnection(ctx context.Context, conn net.Conn, metadata adapter.InboundContext) error

Deprecated: use RouteConnectionEx instead.

func (*Router) RouteConnectionEx

func (r *Router) RouteConnectionEx(ctx context.Context, conn net.Conn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*Router) RoutePacketConnection

func (r *Router) RoutePacketConnection(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext) error

func (*Router) RoutePacketConnectionEx

func (r *Router) RoutePacketConnectionEx(ctx context.Context, conn N.PacketConn, metadata adapter.InboundContext, onClose N.CloseHandlerFunc)

func (*Router) RuleSet added in v1.8.0

func (r *Router) RuleSet(tag string) (adapter.RuleSet, bool)

func (*Router) Rules

func (r *Router) Rules() []adapter.Rule

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) Start

func (r *Router) Start() error

func (*Router) UpdateInterfaces added in v1.2.5

func (r *Router) UpdateInterfaces() error

func (*Router) V2RayServer added in v1.1.0

func (r *Router) V2RayServer() adapter.V2RayServer

func (*Router) WIFIState added in v1.7.0

func (r *Router) WIFIState() adapter.WIFIState

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL