Documentation ¶
Index ¶
- Variables
- func FakeIPRange() netip.Prefix
- func IsSniffing() bool
- func Listeners() map[string]C.InboundListener
- func NatTable() C.NatTable
- func OnInnerLoading()
- func OnRunning()
- func OnSuspend()
- func Providers() map[string]provider.ProxyProvider
- func Proxies() map[string]C.Proxy
- func ProxiesWithProviders() map[string]C.Proxy
- func RuleProviders() map[string]provider.RuleProvider
- func Rules() []C.Rule
- func SetFakeIPRange(p netip.Prefix)
- func SetFindProcessMode(mode P.FindProcessMode)
- func SetMode(m TunnelMode)
- func SetSniffing(b bool)
- func TCPIn() chan<- C.ConnContext
- func UDPIn() chan<- C.PacketAdapter
- func UpdateListeners(newListeners map[string]C.InboundListener)
- func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provider.ProxyProvider)
- func UpdateRules(newRules []C.Rule, newSubRule map[string][]C.Rule, ...)
- func UpdateSniffer(dispatcher *sniffer.SnifferDispatcher)
- type AtomicStatus
- type TunnelMode
- type TunnelStatus
Constants ¶
This section is empty.
Variables ¶
var ModeMapping = map[string]TunnelMode{ Global.String(): Global, Rule.String(): Rule, Direct.String(): Direct, }
ModeMapping is a mapping for Mode enum
var StatusMapping = map[string]TunnelStatus{ Suspend.String(): Suspend, Inner.String(): Inner, Running.String(): Running, }
StatusMapping is a mapping for Status enum
var Tunnel C.Tunnel = tunnel{}
Functions ¶
func FakeIPRange ¶
func IsSniffing ¶
func IsSniffing() bool
func Listeners ¶
func Listeners() map[string]C.InboundListener
func OnInnerLoading ¶
func OnInnerLoading()
func Providers ¶
func Providers() map[string]provider.ProxyProvider
Providers return all compatible providers
func ProxiesWithProviders ¶
func RuleProviders ¶
func RuleProviders() map[string]provider.RuleProvider
RuleProviders return all loaded rule providers
func SetFakeIPRange ¶
func SetFindProcessMode ¶
func SetFindProcessMode(mode P.FindProcessMode)
SetFindProcessMode replace SetAlwaysFindProcess always find process info if legacyAlways = true or mode.Always() = true, may be increase many memory
func SetSniffing ¶
func SetSniffing(b bool)
func TCPIn ¶
func TCPIn() chan<- C.ConnContext
TCPIn return fan-in queue Deprecated: using Tunnel instead
func UDPIn ¶
func UDPIn() chan<- C.PacketAdapter
UDPIn return fan-in udp queue Deprecated: using Tunnel instead
func UpdateListeners ¶
func UpdateListeners(newListeners map[string]C.InboundListener)
func UpdateProxies ¶
UpdateProxies handle update proxies
func UpdateRules ¶
func UpdateRules(newRules []C.Rule, newSubRule map[string][]C.Rule, rp map[string]provider.RuleProvider)
UpdateRules handle update rules
func UpdateSniffer ¶
func UpdateSniffer(dispatcher *sniffer.SnifferDispatcher)
Types ¶
type AtomicStatus ¶
type AtomicStatus struct {
// contains filtered or unexported fields
}
func (*AtomicStatus) Load ¶
func (a *AtomicStatus) Load() TunnelStatus
func (*AtomicStatus) Store ¶
func (a *AtomicStatus) Store(s TunnelStatus)
func (*AtomicStatus) String ¶
func (a *AtomicStatus) String() string
type TunnelMode ¶
type TunnelMode int
const ( Global TunnelMode = iota Rule Direct )
func (TunnelMode) MarshalJSON ¶
func (m TunnelMode) MarshalJSON() ([]byte, error)
MarshalJSON serialize Mode
func (TunnelMode) MarshalYAML ¶
func (m TunnelMode) MarshalYAML() (any, error)
MarshalYAML serialize TunnelMode with yaml
func (TunnelMode) String ¶
func (m TunnelMode) String() string
func (*TunnelMode) UnmarshalJSON ¶
func (m *TunnelMode) UnmarshalJSON(data []byte) error
UnmarshalJSON unserialize Mode
func (*TunnelMode) UnmarshalYAML ¶
func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML unserialize Mode with yaml
type TunnelStatus ¶
type TunnelStatus int
const ( Suspend TunnelStatus = iota Inner Running )
func Status ¶
func Status() TunnelStatus
func (TunnelStatus) MarshalJSON ¶
func (s TunnelStatus) MarshalJSON() ([]byte, error)
MarshalJSON serialize Status
func (TunnelStatus) MarshalYAML ¶
func (s TunnelStatus) MarshalYAML() (any, error)
MarshalYAML serialize TunnelMode with yaml
func (TunnelStatus) String ¶
func (s TunnelStatus) String() string
func (*TunnelStatus) UnmarshalJSON ¶
func (s *TunnelStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON unserialize Status
func (*TunnelStatus) UnmarshalYAML ¶
func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML unserialize Status with yaml