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 ¶ added in v1.17.0
func IsSniffing ¶ added in v1.17.0
func IsSniffing() bool
func Listeners ¶ added in v1.17.0
func Listeners() map[string]C.InboundListener
func OnInnerLoading ¶ added in v1.17.0
func OnInnerLoading()
func Providers ¶ added in v1.17.0
func Providers() map[string]provider.ProxyProvider
Providers return all compatible providers
func ProxiesWithProviders ¶ added in v1.17.0
func RuleProviders ¶ added in v1.17.0
func RuleProviders() map[string]provider.RuleProvider
RuleProviders return all loaded rule providers
func SetFakeIPRange ¶ added in v1.17.0
func SetFindProcessMode ¶ added in v1.17.0
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 ¶ added in v1.17.0
func SetSniffing(b bool)
func TCPIn ¶ added in v1.17.0
func TCPIn() chan<- C.ConnContext
TCPIn return fan-in queue Deprecated: using Tunnel instead
func UDPIn ¶ added in v1.17.0
func UDPIn() chan<- C.PacketAdapter
UDPIn return fan-in udp queue Deprecated: using Tunnel instead
func UpdateListeners ¶ added in v1.17.0
func UpdateListeners(newListeners map[string]C.InboundListener)
func UpdateProxies ¶ added in v1.17.0
UpdateProxies handle update proxies
func UpdateRules ¶ added in v1.17.0
func UpdateRules(newRules []C.Rule, newSubRule map[string][]C.Rule, rp map[string]provider.RuleProvider)
UpdateRules handle update rules
func UpdateSniffer ¶ added in v1.17.0
func UpdateSniffer(dispatcher *sniffer.SnifferDispatcher)
Types ¶
type AtomicStatus ¶ added in v1.17.0
type AtomicStatus struct {
// contains filtered or unexported fields
}
func (*AtomicStatus) Load ¶ added in v1.17.0
func (a *AtomicStatus) Load() TunnelStatus
func (*AtomicStatus) Store ¶ added in v1.17.0
func (a *AtomicStatus) Store(s TunnelStatus)
func (*AtomicStatus) String ¶ added in v1.17.0
func (a *AtomicStatus) String() string
type TunnelMode ¶ added in v1.17.0
type TunnelMode int
const ( Global TunnelMode = iota Rule Direct )
func (TunnelMode) MarshalJSON ¶ added in v1.17.0
func (m TunnelMode) MarshalJSON() ([]byte, error)
MarshalJSON serialize Mode
func (TunnelMode) MarshalYAML ¶ added in v1.17.0
func (m TunnelMode) MarshalYAML() (any, error)
MarshalYAML serialize TunnelMode with yaml
func (TunnelMode) String ¶ added in v1.17.0
func (m TunnelMode) String() string
func (*TunnelMode) UnmarshalJSON ¶ added in v1.17.0
func (m *TunnelMode) UnmarshalJSON(data []byte) error
UnmarshalJSON unserialize Mode
func (*TunnelMode) UnmarshalYAML ¶ added in v1.17.0
func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML unserialize Mode with yaml
type TunnelStatus ¶ added in v1.17.0
type TunnelStatus int
const ( Suspend TunnelStatus = iota Inner Running )
func Status ¶ added in v1.17.0
func Status() TunnelStatus
func (TunnelStatus) MarshalJSON ¶ added in v1.17.0
func (s TunnelStatus) MarshalJSON() ([]byte, error)
MarshalJSON serialize Status
func (TunnelStatus) MarshalYAML ¶ added in v1.17.0
func (s TunnelStatus) MarshalYAML() (any, error)
MarshalYAML serialize TunnelMode with yaml
func (TunnelStatus) String ¶ added in v1.17.0
func (s TunnelStatus) String() string
func (*TunnelStatus) UnmarshalJSON ¶ added in v1.17.0
func (s *TunnelStatus) UnmarshalJSON(data []byte) error
UnmarshalJSON unserialize Status
func (*TunnelStatus) UnmarshalYAML ¶ added in v1.17.0
func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML unserialize Status with yaml