yuhaiin

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowLanKey     = "allow_lan"
	AppendHTTPProxy = "Append HTTP Proxy to VPN"
	IPv6Key         = "ipv6"
	AutoConnectKey  = "auto_connect"
	PerAppKey       = "per_app"
	AppBypassKey    = "app_bypass"
	UDPProxyFQDNKey = "UDP proxy FQDN"
	SniffKey        = "Sniff"
	SaveLogcatKey   = "save_logcat"

	RouteKey         = "route"
	FakeDNSCIDRKey   = "fake_dns_cidr"
	FakeDNSv6CIDRKey = "fake_dnsv6_cidr"
	TunDriverKey     = "Tun Driver"
	AppListKey       = "app_list"
	LogLevelKey      = "Log Level"
	RuleByPassUrlKey = "Rule Update Bypass"
	RemoteRulesKey   = "remote_rules"
	BlockKey         = "Block"
	ProxyKey         = "Proxy"
	DirectKey        = "Direct"
	TCPBypassKey     = "TCP"
	UDPBypassKey     = "UDP"
	HostsKey         = "hosts"

	DNSPortKey     = "dns_port"
	HTTPPortKey    = "http_port"
	YuhaiinPortKey = "yuhaiin_port"

	DNSHijackingKey = "dns_hijacking"

	RemoteDNSHostKey          = "remote_dns_host"
	RemoteDNSTypeKey          = "remote_dns_type"
	RemoteDNSSubnetKey        = "remote_dns_subnet"
	RemoteDNSTLSServerNameKey = "remote_dns_tls_server_name"
	RemoteDNSResolveDomainKey = "remote_dns_resolve_domain"

	LocalDNSHostKey          = "local_dns_host"
	LocalDNSTypeKey          = "local_dns_type"
	LocalDNSSubnetKey        = "local_dns_subnet"
	LocalDNSTLSServerNameKey = "local_dns_tls_server_name"

	BootstrapDNSHostKey          = "bootstrap_dns_host"
	BootstrapDNSTypeKey          = "bootstrap_dns_type"
	BootstrapDNSSubnetKey        = "bootstrap_dns_subnet"
	BootstrapDNSTLSServerNameKey = "bootstrap_dns_tls_server_name"
)

Functions

func AddRulesCidr

func AddRulesCidr(process AddRoute, rules string)

func CloseStore added in v0.3.7

func CloseStore()

func InitDB

func InitDB(path string) error

func NewUidDumper

func NewUidDumper(ud UidDumper) netapi.ProcessDumper

Types

type AddRoute

type AddRoute interface {
	Add(*CIDR)
}

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 string) error

func (*App) Start

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

func (*App) Stop

func (a *App) Stop() error

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 MapStore added in v0.3.7

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

func MapStoreFromJson added in v0.3.7

func MapStoreFromJson(data []byte) *MapStore

func (*MapStore) GetBoolean added in v0.3.7

func (m *MapStore) GetBoolean(key string) bool

func (*MapStore) GetFloat added in v0.3.7

func (m *MapStore) GetFloat(key string) float32

func (*MapStore) GetInt added in v0.3.7

func (m *MapStore) GetInt(key string) int32

func (*MapStore) GetLong added in v0.3.7

func (m *MapStore) GetLong(key string) int64

func (*MapStore) GetString added in v0.3.7

func (m *MapStore) GetString(key string) string

type NotifySpped added in v0.3.7

type NotifySpped interface {
	NotifyEnable() bool
	Notify(str string)
}

type Opts

type Opts struct {
	CloseFallback Closer
	NotifySpped   NotifySpped
	MapStore      *MapStore
	TUN           *TUN   `json:"tun"`
	Savepath      string `json:"savepath"`
}

type SocketProtect

type SocketProtect interface {
	Protect(socket int32) bool
}

type Store added in v0.3.7

type Store interface {
	PutString(key string, value string)
	PutInt(key string, value int32)
	PutBoolean(key string, value bool)
	PutLong(key string, value int64)
	PutFloat(key string, value float32)
	GetString(key string) string
	GetInt(key string) int32
	GetBoolean(key string) bool
	GetLong(key string) int64
	GetFloat(key string) float32
	Dump() []byte
}

func GetStore added in v0.3.7

func GetStore(prefix string) Store

type TUN

type TUN struct {
	UidDumper     UidDumper
	SocketProtect SocketProtect
	Portal        string `json:"portal"`
	PortalV6      string `json:"portal_v6"`
	FD            int32  `json:"fd"`
	MTU           int32  `json:"mtu"`
}

type UidDumper

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

Jump to

Keyboard shortcuts

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