tunnel

package
v1.53.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

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 added in v1.50.0

func FetchRawProxyAdapter(proxy C.Proxy, metadata *C.Metadata) (C.Proxy, []string)

func FindProxyByName added in v1.50.0

func FindProxyByName(name string) (proxy C.Proxy, found bool)

func Providers added in v1.50.0

func Providers() map[string]provider.ProxyProvider

Providers return all compatible providers

func Proxies added in v1.50.0

func Proxies() map[string]C.Proxy

Proxies return all proxies

func Rewrites added in v1.50.0

func Rewrites() C.RewriteRule

Rewrites return all rewrites

func Rules added in v1.50.0

func Rules() []C.Rule

Rules return all rules

func SetMitmOutbound added in v1.50.0

func SetMitmOutbound(outbound C.ProxyAdapter)

SetMitmOutbound set the MITM outbound

func SetMode added in v1.50.0

func SetMode(m TunnelMode)

SetMode change the mode of tunnel

func SetSniffing added in v1.50.0

func SetSniffing(s bool)

func Sniffing added in v1.50.0

func Sniffing() bool

func TCPIn added in v1.50.0

func TCPIn() chan<- C.ConnContext

TCPIn return fan-in queue

func UDPIn added in v1.50.0

func UDPIn() chan<- *inbound.PacketAdapter

UDPIn return fan-in udp queue

func UpdateProxies added in v1.50.0

func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provider.ProxyProvider)

UpdateProxies handle update proxies

func UpdateRewrites added in v1.50.0

func UpdateRewrites(hosts *trie.DomainTrie[bool], rules C.RewriteRule)

UpdateRewrites handle update rewrites

func UpdateRules added in v1.50.0

func UpdateRules(newRules []C.Rule)

UpdateRules handle update rules

func UpdateScript added in v1.50.0

func UpdateScript(providers map[string]C.Rule, matcher C.Matcher)

UpdateScript update script config

Types

type TunnelMode added in v1.50.0

type TunnelMode int
const (
	Global TunnelMode = iota
	Rule
	Script
	Direct
)

func Mode added in v0.5.0

func Mode() TunnelMode

Mode return current mode

func (TunnelMode) MarshalJSON added in v1.50.0

func (m TunnelMode) MarshalJSON() ([]byte, error)

MarshalJSON serialize Mode

func (TunnelMode) MarshalYAML added in v1.50.0

func (m TunnelMode) MarshalYAML() (any, error)

MarshalYAML serialize TunnelMode with yaml

func (TunnelMode) String added in v1.50.0

func (m TunnelMode) String() string

func (*TunnelMode) UnmarshalJSON added in v1.50.0

func (m *TunnelMode) UnmarshalJSON(data []byte) error

UnmarshalJSON unserialize Mode

func (*TunnelMode) UnmarshalYAML added in v1.50.0

func (m *TunnelMode) UnmarshalYAML(unmarshal func(any) error) error

UnmarshalYAML unserialize Mode with yaml

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL