Documentation ¶
Index ¶
- Constants
- Variables
- func AddStrRule(key string, value string)
- func CloseRuleMatchCon(rule C.Rule)
- func DeleteStrRule(key string)
- func DnsPreCache(domain string, ip string, remote net.Addr, ttl uint32)
- func GetnatPC(key string) C.PacketConn
- func LoadRule(rules []C.Rule) []C.Rule
- func LoadStrRule() []C.Rule
- func Providers() map[string]provider.ProxyProvider
- func Proxies() map[string]C.Proxy
- func Rules() []C.Rule
- func SetMode(m TunnelMode)
- func TCPIn() chan<- C.ConnContext
- func TrimArr(arr []string) (r []string)
- func UDPIn() chan<- *inbound.PacketAdapter
- func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provider.ProxyProvider)
- func UpdateRules(newRules []C.Rule)
- type IdleTimeoutConn
- type ReadOnlyReader
- type TunnelMode
- type WriteOnlyWriter
Constants ¶
View Source
const MapStringRule = "map-string-rule"
const MapDomainRule = "map-domain-rule" const MapIPRule = "map-domain-rule"
Variables ¶
View Source
var (
//Cm *concurrent_map.ConcurrentMap
//Cm = CMAP.New()
//Cm = CC.New(CC.Configure().MaxSize(1024 * 128).ItemsToPrune(500).Buckets(1024 * 128 / 64))
//Dm = CC.New(CC.Configure().MaxSize(1024 * 128).ItemsToPrune(500).Buckets(1024 * 128 / 64))
Cm, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 1e7,
MaxCost: 1 << 28,
BufferItems: 64,
})
Dm, _ = ristretto.NewCache(&ristretto.Config{
NumCounters: 1e7,
MaxCost: 1 << 28,
BufferItems: 64,
})
)
View Source
var ( // ModeMapping is a mapping for Mode enum ModeMapping = map[string]TunnelMode{ Global.String(): Global, Rule.String(): Rule, Direct.String(): Direct, } )
Functions ¶
func AddStrRule ¶
func CloseRuleMatchCon ¶
func DeleteStrRule ¶
func DeleteStrRule(key string)
func GetnatPC ¶
func GetnatPC(key string) C.PacketConn
func LoadStrRule ¶
func Providers ¶
func Providers() map[string]provider.ProxyProvider
Providers return all compatible providers
func UpdateProxies ¶
UpdateProxies handle update proxies
Types ¶
type ReadOnlyReader ¶
type TunnelMode ¶
type TunnelMode int
const ( Global TunnelMode = iota Rule Direct )
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
type WriteOnlyWriter ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.