Documentation ¶
Index ¶
- Variables
- func FetchRawProxyAdapter(proxy C.Proxy, metadata *C.Metadata) (C.Proxy, []string)
- func FindProxyByName(name string) (proxy C.Proxy, found bool)
- func Providers() map[string]provider.ProxyProvider
- func Proxies() map[string]C.Proxy
- func Rewrites() C.RewriteRule
- func Rules() []C.Rule
- func SetMitmOutbound(outbound C.ProxyAdapter)
- func SetMode(m TunnelMode)
- func SetSniffing(s bool)
- func Sniffing() bool
- func TCPIn() chan<- C.ConnContext
- func UDPIn() chan<- *inbound.PacketAdapter
- func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provider.ProxyProvider)
- func UpdateRewrites(hosts *trie.DomainTrie[bool], rules C.RewriteRule)
- func UpdateRules(newRules []C.Rule)
- func UpdateScript(providers map[string]C.Rule, matcher C.Matcher)
- type TunnelMode
- func (m TunnelMode) MarshalJSON() ([]byte, error)
- func (m TunnelMode) MarshalObject(e *log.Entry)
- func (m TunnelMode) MarshalYAML() (any, error)
- func (m TunnelMode) String() string
- func (m *TunnelMode) UnmarshalJSON(data []byte) error
- func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( UDPFallbackMatch = atomic.NewBool(false) UDPFallbackPolicy = atomic.NewString("") )
View Source
var ModeMapping = map[string]TunnelMode{ Global.String(): Global, Rule.String(): Rule, Script.String(): Script, Direct.String(): Direct, }
ModeMapping is a mapping for Mode enum
Functions ¶
func FetchRawProxyAdapter ¶
func Providers ¶
func Providers() map[string]provider.ProxyProvider
Providers return all compatible providers
func SetMitmOutbound ¶
func SetMitmOutbound(outbound C.ProxyAdapter)
SetMitmOutbound set the MITM outbound
func SetSniffing ¶
func SetSniffing(s bool)
func UpdateProxies ¶
UpdateProxies handle update proxies
func UpdateRewrites ¶
func UpdateRewrites(hosts *trie.DomainTrie[bool], rules C.RewriteRule)
UpdateRewrites handle update rewrites
Types ¶
type TunnelMode ¶
type TunnelMode int
const ( Global TunnelMode = iota Rule Script Direct )
func (TunnelMode) MarshalJSON ¶
func (m TunnelMode) MarshalJSON() ([]byte, error)
MarshalJSON serialize Mode
func (TunnelMode) MarshalObject ¶
func (m TunnelMode) MarshalObject(e *log.Entry)
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
Click to show internal directories.
Click to hide internal directories.