Versions in this module Expand all Collapse all v0 v0.0.1 Sep 18, 2023 Changes in this version + func ContextWithRouter(ctx context.Context, router Router) context.Context + func OutboundTag(detour Outbound) string + func UpstreamMetadata(metadata InboundContext) M.Metadata + func WithContext(ctx context.Context, inboundContext *InboundContext) context.Context + type ClashCacheFile interface + LoadGroupExpand func(group string) (isExpand bool, loaded bool) + LoadMode func() string + LoadSelected func(group string) string + StoreGroupExpand func(group string, expand bool) error + StoreMode func(mode string) error + StoreSelected func(group string, selected string) error + type ClashServer interface + CacheFile func() ClashCacheFile + HistoryStorage func() *urltest.HistoryStorage + Mode func() string + ModeList func() []string + RoutedConnection func(ctx context.Context, conn net.Conn, metadata InboundContext, matchedRule Rule) (net.Conn, Tracker) + RoutedPacketConnection func(ctx context.Context, conn N.PacketConn, metadata InboundContext, ...) (N.PacketConn, Tracker) + StoreFakeIP func() bool + StoreSelected func() bool + type ConnectionHandler interface + NewConnection func(ctx context.Context, conn net.Conn, metadata InboundContext) error + type ConnectionHandlerFunc = func(ctx context.Context, conn net.Conn, metadata InboundContext) error + type DNSRule interface + DisableCache func() bool + RewriteTTL func() *uint32 + type FakeIPMetadata struct + Inet4Current netip.Addr + Inet4Range netip.Prefix + Inet6Current netip.Addr + Inet6Range netip.Prefix + func (m *FakeIPMetadata) MarshalBinary() (data []byte, err error) + func (m *FakeIPMetadata) UnmarshalBinary(data []byte) error + type FakeIPStorage interface + FakeIPLoad func(address netip.Addr) (string, bool) + FakeIPLoadDomain func(domain string, isIPv6 bool) (netip.Addr, bool) + FakeIPMetadata func() *FakeIPMetadata + FakeIPReset func() error + FakeIPSaveMetadata func(metadata *FakeIPMetadata) error + FakeIPSaveMetadataAsync func(metadata *FakeIPMetadata) + FakeIPStore func(address netip.Addr, domain string) error + FakeIPStoreAsync func(address netip.Addr, domain string, logger logger.Logger) + type FakeIPStore interface + Contains func(address netip.Addr) bool + Create func(domain string, isIPv6 bool) (netip.Addr, error) + Lookup func(address netip.Addr) (string, bool) + Reset func() error + type FakeIPTransport interface + Store func() FakeIPStore + type Inbound interface + Tag func() string + Type func() string + type InboundContext struct + Destination M.Socksaddr + DestinationAddresses []netip.Addr + Domain string + FakeIP bool + GeoIPCode string + IPVersion uint8 + Inbound string + InboundDetour string + InboundOptions option.InboundOptions + InboundType string + LastInbound string + Network string + OriginDestination M.Socksaddr + Outbound string + ProcessInfo *process.Info + Protocol string + QueryType uint16 + Source M.Socksaddr + SourceGeoIPCode string + User string + func AppendContext(ctx context.Context) (context.Context, *InboundContext) + func ContextFrom(ctx context.Context) *InboundContext + type InjectableInbound interface + Network func() []string + NewConnection func(ctx context.Context, conn net.Conn, metadata InboundContext) error + NewPacketConnection func(ctx context.Context, conn N.PacketConn, metadata InboundContext) error + type InterfaceUpdateListener interface + InterfaceUpdated func() + type OOBPacketHandler interface + NewPacket func(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, oob []byte, ...) error + type Outbound interface + Dependencies func() []string + Network func() []string + NewConnection func(ctx context.Context, conn net.Conn, metadata InboundContext) error + NewPacketConnection func(ctx context.Context, conn N.PacketConn, metadata InboundContext) error + Tag func() string + Type func() string + type OutboundGroup interface + All func() []string + Now func() string + type PacketConnectionHandler interface + NewPacketConnection func(ctx context.Context, conn N.PacketConn, metadata InboundContext) error + type PacketConnectionHandlerFunc = func(ctx context.Context, conn N.PacketConn, metadata InboundContext) error + type PacketHandler interface + NewPacket func(ctx context.Context, conn N.PacketConn, buffer *buf.Buffer, ...) error + type PostStarter interface + PostStart func() error + type PreStarter interface + PreStart func() error + type Router interface + AutoDetectInterface func() bool + AutoDetectInterfaceFunc func() control.Func + ClashServer func() ClashServer + ClearDNSCache func() + DefaultInterface func() string + DefaultMark func() int + DefaultOutbound func(network string) Outbound + Exchange func(ctx context.Context, message *mdns.Msg) (*mdns.Msg, error) + FakeIPStore func() FakeIPStore + GeoIPReader func() *geoip.Reader + InterfaceFinder func() control.InterfaceFinder + InterfaceMonitor func() tun.DefaultInterfaceMonitor + LoadGeosite func(code string) (Rule, error) + Lookup func(ctx context.Context, domain string, strategy dns.DomainStrategy) ([]netip.Addr, error) + LookupDefault func(ctx context.Context, domain string) ([]netip.Addr, error) + NetworkMonitor func() tun.NetworkUpdateMonitor + Outbound func(tag string) (Outbound, bool) + Outbounds func() []Outbound + PackageManager func() tun.PackageManager + ResetNetwork func() error + RouteConnection func(ctx context.Context, conn net.Conn, metadata InboundContext) error + RoutePacketConnection func(ctx context.Context, conn N.PacketConn, metadata InboundContext) error + Rules func() []Rule + SetClashServer func(server ClashServer) + SetV2RayServer func(server V2RayServer) + UpdateInterfaces func() error + V2RayServer func() V2RayServer + func RouterFromContext(ctx context.Context) Router + type Rule interface + Match func(metadata *InboundContext) bool + Outbound func() string + String func() string + Type func() string + UpdateGeosite func() error + type Service interface + Close func() error + Start func() error + type TimeService interface + TimeFunc func() func() time.Time + type Tracker interface + Leave func() + type URLTestGroup interface + URLTest func(ctx context.Context, url string) (map[string]uint16, error) + type UpstreamHandlerAdapter interface + func NewUpstreamContextHandler(connectionHandler ConnectionHandlerFunc, ...) UpstreamHandlerAdapter + func NewUpstreamHandler(metadata InboundContext, connectionHandler ConnectionHandlerFunc, ...) UpstreamHandlerAdapter + type V2RayClientTransport interface + DialContext func(ctx context.Context) (net.Conn, error) + type V2RayServer interface + StatsService func() V2RayStatsService + type V2RayServerTransport interface + Close func() error + Network func() []string + Serve func(listener net.Listener) error + ServePacket func(listener net.PacketConn) error + type V2RayServerTransportHandler interface + FallbackConnection func(ctx context.Context, conn net.Conn, metadata M.Metadata) error + type V2RayStatsService interface + RoutedConnection func(inbound string, outbound string, user string, conn net.Conn) net.Conn + RoutedPacketConnection func(inbound string, outbound string, user string, conn N.PacketConn) N.PacketConn