yuhaiin

package
v0.3.1-beta.4 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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"`
	Proxy         bool   `json:"proxy"`
	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"`
	Remote         *DNS   `json:"remote"`
	Local          *DNS   `json:"local"`
	Bootstrap      *DNS   `json:"bootstrap"`
}

type Opts

type Opts struct {
	Host       string      `json:"host"`
	Savepath   string      `json:"savepath"`
	Socks5     string      `json:"socks5"`
	Http       string      `json:"http"`
	SaveLogcat bool        `json:"save_logcat"`
	Bypass     *Bypass     `json:"bypass"`
	DNS        *DNSSetting `json:"dns"`
	TUN        *TUN        `json:"tun"`
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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