yuhaiin

package
v0.3.1-rc.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewUidDumper

func NewUidDumper(ud UidDumper) listener.ProcessDumper

Types

type App

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

func (*App) Running

func (a *App) Running() bool

func (*App) SaveNewBypass

func (a *App) SaveNewBypass(link, dir string) error

func (*App) Start

func (a *App) Start(opt *Opts) error

func (*App) Stop

func (a *App) Stop() error

type Bypass

type Bypass struct {
	// 0: bypass, 1: proxy, 2: direct, 3: block
	TCP int32 `json:"tcp"`
	// 0: bypass, 1: proxy, 2: direct, 3: block
	UDP int32 `json:"udp"`

	Block  string `json:"block"`
	Proxy  string `json:"proxy"`
	Direct string `json:"direct"`
}

type CIDR

type CIDR struct {
	IP   string
	Mask int32
}

func ParseCIDR

func ParseCIDR(s string) (*CIDR, error)

type Closer

type Closer interface {
	Close() error
}

type DNS

type DNS struct {
	Host string `json:"host"`
	// Type
	// 0: reserve
	// 1: udp
	// 2: tcp
	// 3: doh
	// 4: dot
	// 5: doq
	// 6: doh3
	Type          int32  `json:"type"`
	Subnet        string `json:"subnet"`
	TlsServername string `json:"tls_servername"`
}

type DNSSetting

type DNSSetting struct {
	Server              string `json:"server"`
	Fakedns             bool   `json:"fakedns"`
	FakednsIpRange      string `json:"fakedns_ip_range"`
	ResolveRemoteDomain bool   `json:"resolve_remote_domain"`
	Remote              *DNS   `json:"remote"`
	Local               *DNS   `json:"local"`
	Bootstrap           *DNS   `json:"bootstrap"`
	Hosts               []byte `json:"hosts"`
}

type Log

type Log struct {
	SaveLogcat bool `json:"save_logcat"`
	// 0:verbose, 1:debug, 2:info, 3:warning, 4:error, 5: fatal
	LogLevel int32 `json:"log_level"`
}

type Opts

type Opts struct {
	Host          string      `json:"host"`
	Savepath      string      `json:"savepath"`
	Socks5        string      `json:"socks5"`
	Http          string      `json:"http"`
	IPv6          bool        `json:"ipv6"`
	Bypass        *Bypass     `json:"bypass"`
	DNS           *DNSSetting `json:"dns"`
	TUN           *TUN        `json:"tun"`
	Log           *Log        `json:"log"`
	CloseFallback Closer
}

type SocketProtect

type SocketProtect interface {
	Protect(socket int32) bool
}

type TUN

type TUN struct {
	FD           int32  `json:"fd"`
	MTU          int32  `json:"mtu"`
	Gateway      string `json:"gateway"`
	Portal       string `json:"portal"`
	DNSHijacking bool   `json:"dns_hijacking"`
	// Driver
	// 0: fdbased
	// 1: channel
	// 2: tun2socket
	// 3: tun2socket_gvisor
	Driver        int32 `json:"driver"`
	UidDumper     UidDumper
	SocketProtect SocketProtect
}

type UidDumper

type UidDumper interface {
	DumpUid(ipProto int32, srcIp string, srcPort int32, destIp string, destPort int32) (int32, error)
	GetUidInfo(uid int32) (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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