tunnel

package
v1.7.1-0...-07bc005 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2021 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const MapDomainRule = "map-domain-rule"
View Source
const MapIPRule = "map-domain-rule"

Variables

View Source
var (
	//Cm *concurrent_map.ConcurrentMap
	//Cm     = CMAP.New()
	Cm = CC.New(CC.Configure().MaxSize(1024 * 64).ItemsToPrune(500))
	Am = &HS.HashMap{}
	Bm = syncmap.Map{}
)
View Source
var (
	// ModeMapping is a mapping for Mode enum
	ModeMapping = map[string]TunnelMode{
		Global.String(): Global,
		Rule.String():   Rule,
		Direct.String(): Direct,
	}
)
View Source
var (
	TakeSpaceValue = []byte{}
)

Functions

func AddDomainRule

func AddDomainRule(key string, value string)

func AddIPRule

func AddIPRule(key string, value string)

func DeleteDomainRule

func DeleteDomainRule(key string)

func DeleteIPRule

func DeleteIPRule(key string)

func DnsPreCache

func DnsPreCache(domain string)

func LoadDomainRule

func LoadDomainRule() []C.Rule

func LoadIPRule

func LoadIPRule() []C.Rule

func LoadRule

func LoadRule(rules []C.Rule) []C.Rule

func Providers

func Providers() map[string]provider.ProxyProvider

Providers return all compatible providers

func Proxies

func Proxies() map[string]C.Proxy

Proxies return all proxies

func Rules

func Rules() []C.Rule

Rules return all rules

func SetMode

func SetMode(m TunnelMode)

SetMode change the mode of tunnel

func TCPIn

func TCPIn() chan<- C.ConnContext

TCPIn return fan-in queue

func UDPIn

func UDPIn() chan<- *inbound.PacketAdapter

UDPIn return fan-in udp queue

func UpdateProxies

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

UpdateProxies handle update proxies

func UpdateRules

func UpdateRules(newRules []C.Rule)

UpdateRules handle update rules

Types

type TunnelMode

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

func Mode

func Mode() TunnelMode

Mode return current mode

func (TunnelMode) MarshalJSON

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

MarshalJSON serialize Mode

func (TunnelMode) MarshalYAML

func (m TunnelMode) MarshalYAML() (interface{}, 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(interface{}) 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