Documentation ¶
Index ¶
- Constants
- Variables
- func FakeIPRange() netip.Prefix
- func FindProcessMode() P.FindProcessMode
- 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.Dispatcher)
- type AtomicStatus
- type DNSDialer
- type TunnelMode
- func (m TunnelMode) MarshalJSON() ([]byte, error)
- func (m TunnelMode) MarshalText() ([]byte, error)
- func (m TunnelMode) MarshalYAML() (any, error)
- func (m TunnelMode) String() string
- func (m *TunnelMode) UnmarshalJSON(data []byte) error
- func (m *TunnelMode) UnmarshalText(data []byte) error
- func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error
- type TunnelStatus
- func (s TunnelStatus) MarshalJSON() ([]byte, error)
- func (s TunnelStatus) MarshalText() ([]byte, error)
- func (s TunnelStatus) MarshalYAML() (any, error)
- func (s TunnelStatus) String() string
- func (s *TunnelStatus) UnmarshalJSON(data []byte) error
- func (s *TunnelStatus) UnmarshalText(data []byte) error
- func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error
Constants ¶
const DnsRespectRules = "RULES"
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 = tunnel{}
Functions ¶
func FakeIPRange ¶ added in v1.17.0
func FindProcessMode ¶ added in v1.18.8
func FindProcessMode() P.FindProcessMode
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.Dispatcher)
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 DNSDialer ¶ added in v1.18.6
type DNSDialer struct {
// contains filtered or unexported fields
}
func NewDNSDialer ¶ added in v1.18.6
func (*DNSDialer) DialContext ¶ added in v1.18.6
func (*DNSDialer) ListenPacket ¶ added in v1.18.6
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) MarshalText ¶ added in v1.18.9
func (m TunnelMode) MarshalText() ([]byte, error)
MarshalText 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) UnmarshalText ¶ added in v1.18.9
func (m *TunnelMode) UnmarshalText(data []byte) error
UnmarshalText 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) MarshalText ¶ added in v1.18.9
func (s TunnelStatus) MarshalText() ([]byte, error)
MarshalText 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) UnmarshalText ¶ added in v1.18.9
func (s *TunnelStatus) UnmarshalText(data []byte) error
UnmarshalText unserialize Status
func (*TunnelStatus) UnmarshalYAML ¶ added in v1.17.0
func (s *TunnelStatus) UnmarshalYAML(unmarshal func(any) error) error
UnmarshalYAML unserialize Status with yaml