yuhaiin

package
v0.3.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 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               map[string]string `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"`
}

type TUN

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

type UidDumper

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

func NewUidDumper

func NewUidDumper(ud UidDumper) UidDumper

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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