stack

package
v1.1.19 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2022 License: BSD-3-Clause Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DialTimeOut = 8 * time.Second
	MinMtuVal   = 1 << 12
)
View Source
const (
	COMMON_DNS_PORT = 53
	ExpireTime      = time.Minute * 3
)
View Source
const (
	MaxDnsQueryCnt = 1 << 11
)

Variables

This section is empty.

Functions

func SafeConn

func SafeConn(network, rAddr string, connSaver ConnProtector, timeOut time.Duration) (net.Conn, error)

Types

type ConnProtector

type ConnProtector func(fd uintptr)

type IPCache

type IPCache map[string]string

func (*IPCache) String

func (ic *IPCache) String() string

type IpRules added in v1.1.3

type IpRules struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func IPRuleInst added in v1.1.3

func IPRuleInst() *IpRules

func (*IpRules) IsGlobal added in v1.1.3

func (bp *IpRules) IsGlobal() bool

func (*IpRules) IsInnerIP added in v1.1.3

func (bp *IpRules) IsInnerIP(srcIP net.IP) bool

func (*IpRules) IsMustHits added in v1.1.3

func (bp *IpRules) IsMustHits(srcIP net.IP) bool

func (*IpRules) LoadInners added in v1.1.3

func (bp *IpRules) LoadInners(innerIPs string)

func (*IpRules) LoadMustHits added in v1.1.3

func (bp *IpRules) LoadMustHits(ips string)

func (*IpRules) SetGlobal added in v1.1.3

func (bp *IpRules) SetGlobal(g bool)

type Regexps

type Regexps []string

type Rule

type Rule struct {
	// contains filtered or unexported fields
}

func RInst

func RInst() *Rule

func (*Rule) Close added in v1.1.15

func (r *Rule) Close()

func (*Rule) DirectIPAndHOst added in v1.1.17

func (r *Rule) DirectIPAndHOst(host, ip string)

func (*Rule) IsMatched added in v1.1.17

func (r *Rule) IsMatched(s string) bool

func (*Rule) NeedProxy

func (r *Rule) NeedProxy(ip string) string

func (*Rule) ParseDns

func (r *Rule) ParseDns(msg *dnsmessage.Message)

func (*Rule) Setup

func (r *Rule) Setup(s string)

type SimpleStack

type SimpleStack interface {
	SetupStack(dev TunDev, w Wallet) error
	WriteToStack(p []byte) (n int, err error)
	DestroyStack()
}

func Inst

func Inst() SimpleStack

type TunDev

type TunDev interface {
	WriteToTun(p []byte) (n int, err error)
	TunClosed() error
	SafeConn(fd int32) bool
	LoadRule() string
	LoadInnerIps() string
	LoadMustHitIps() string
	MTU() int
}

type Wallet

type Wallet interface {
	Address() string
	AesKeyBase64() string
	MinerNetAddr() string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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