stack

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: BSD-3-Clause Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DialTimeOut = 5 * time.Second
	MinMtuVal   = 1 << 15
)
View Source
const (
	COMMON_DNS_PORT  = 53
	COMMON_DNS_PORT2 = 443
	COMMON_DNS_PORT3 = 853
)

Variables

This section is empty.

Functions

func SafeConn

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

Types

type ByPassIPs added in v1.0.8

type ByPassIPs struct {
	Masks map[string]net.IPMask
	IP    map[string]struct{}
	sync.RWMutex
	// contains filtered or unexported fields
}

func ByPassInst added in v1.0.8

func ByPassInst() *ByPassIPs

func (*ByPassIPs) IsGlobal added in v1.0.8

func (bp *ByPassIPs) IsGlobal() bool

func (*ByPassIPs) IsInnerIP added in v1.0.9

func (bp *ByPassIPs) IsInnerIP(ip net.IP) bool

func (*ByPassIPs) Load added in v1.0.8

func (bp *ByPassIPs) Load(IPS string)

func (*ByPassIPs) SetGlobal added in v1.0.8

func (bp *ByPassIPs) SetGlobal(g bool)

type ConnProtector

type ConnProtector func(fd uintptr)

type IPCache

type IPCache map[string]string

func (*IPCache) String

func (ic *IPCache) String() string

type Regexps

type Regexps []string

type Rule

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

func RInst

func RInst() *Rule

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)
}

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
	LoadIps() 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