yuhaiin

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2025 License: MIT Imports: 37 Imported by: 0

Documentation

Overview

Code generated by strings.go; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	NewHTTPPortKey    = "http_port"
	NewYuhaiinPortKey = "yuhaiin_port"
	NewHostsKey       = "hosts"
)
View Source
var (
	AdvAppBypassKey              = `app_bypass`
	AdvAppListKey                = `app_list`
	AdvAutoConnectKey            = `auto_connect`
	AdvDnsKey                    = `dns`
	AdvDnsPortKey                = `dns_port`
	AdvFakeDnsCidrKey            = `fake_dns_cidr`
	AdvFakeDnsv6CidrKey          = `fake_dnsv6_cidr`
	AdvNewAppListKey             = `new_app_list`
	AdvPerAppKey                 = `per_app`
	AdvRouteKey                  = `route`
	AdvRouteAll                  = `All (Default)`
	AdvRouteNonChn               = `Non-Chinese IPs`
	AdvRouteNonLocal             = `Non-Local IPs`
	AdvTunDriverKey              = `Tun Driver`
	AllowLanKey                  = `allow_lan`
	AppendHttpProxyToVpnKey      = `Append HTTP Proxy to VPN`
	AuthPasswordKey              = `password`
	AuthUsernameKey              = `username`
	AuthUserpwKey                = `auth_userpw`
	BootstrapDnsHostKey          = `bootstrap_dns_host`
	BootstrapDnsSubnetKey        = `bootstrap_dns_subnet`
	BootstrapDnsTlsServerNameKey = `bootstrap_dns_tls_server_name`
	BootstrapDnsTypeKey          = `bootstrap_dns_type`
	BypassBlockValue             = `block`
	BypassBypassValue            = `bypass`
	BypassDirectValue            = `direct`
	BypassProxyValue             = `proxy`
	BypassTcpKey                 = `TCP`
	BypassUdpKey                 = `UDP`
	DnsHijacking                 = `dns_hijacking`
	DnsHostsKey                  = `hosts_key`
	DnsTypeDoh3Value             = `doh3`
	DnsTypeDohValue              = `doh`
	DnsTypeDoqValue              = `doq`
	DnsTypeDotValue              = `dot`
	DnsTypeDotcpValue            = `tcp`
	DnsTypeDoudpValue            = `udp`
	HttpServerPortKey            = `http_server_port`
	Ipv6ProxyKey                 = `ipv6`
	LocalDnsHostKey              = `local_dns_host`
	LocalDnsProxyKey             = `local_dns_proxy`
	LocalDnsSubnetKey            = `local_dns_subnet`
	LocalDnsTlsServerNameKey     = `local_dns_tls_server_name`
	LocalDnsTypeKey              = `local_dns_type`
	LogLevel                     = `Log Level`
	LogLevelDebug                = `debug`
	LogLevelError                = `error`
	LogLevelFatal                = `fatal`
	LogLevelInfo                 = `info`
	LogLevelVerbose              = `verbose`
	LogLevelWarning              = `warning`
	NetworkSpeedKey              = `network_speed`
	PortsKey                     = `ports_key`
	RemoteDnsCategoryKey         = `remote_dns_category`
	RemoteDnsHostKey             = `remote_dns_host`
	RemoteDnsProxyKey            = `remote_dns_proxy`
	RemoteDnsResolveDomainKey    = `remote_dns_resolve_domain`
	RemoteDnsSubnetKey           = `remote_dns_subnet`
	RemoteDnsTlsServerNameKey    = `remote_dns_tls_server_name`
	RemoteDnsTypeKey             = `remote_dns_type`
	RuleBlock                    = `Block`
	RuleDirect                   = `Direct`
	RuleProxy                    = `Proxy`
	RuleUpdateBypassFileKey      = `Rule Update Bypass`
	SaveLogcat                   = `save_logcat`
	SniffKey                     = `Sniff`
	Socks5ServerPortKey          = `socks5_server_port`
	TunDriverChannelValue        = `channel`
	TunDriverFdbasedValue        = `fdbased`
	TunDriverSystemGvisorValue   = `system_gvisor`
	UdpProxyFqdnKey              = `UDP proxy FQDN`
	YuhaiinPortKey               = `yuhaiin_port`

	AdvBypassModeValue = []string{
		BypassBypassValue,
		BypassDirectValue,
		BypassProxyValue,
		BypassBlockValue,
	}

	AdvRoutes = []string{
		AdvRouteAll,
		AdvRouteNonLocal,
		AdvRouteNonChn,
	}

	DnsTypesValue = []string{
		DnsTypeDoudpValue,
		DnsTypeDotcpValue,
		DnsTypeDohValue,
		DnsTypeDotValue,
		DnsTypeDoqValue,
		DnsTypeDoh3Value,
	}

	LogLevels = []string{
		LogLevelVerbose,
		LogLevelDebug,
		LogLevelInfo,
		LogLevelWarning,
		LogLevelError,
		LogLevelFatal,
	}

	TunDriversValue = []string{
		TunDriverFdbasedValue,
		TunDriverChannelValue,
		TunDriverSystemGvisorValue,
	}
)

Functions

func AddFakeDnsCidr added in v0.3.8

func AddFakeDnsCidr(process AddRoute)

func AddRulesCidrv2 added in v0.3.8

func AddRulesCidrv2(process AddRoute)

func CloseStore added in v0.3.7

func CloseStore()

func FakeDnsCidr added in v0.3.8

func FakeDnsCidr(f func(string))

func InitDB

func InitDB(path string, sp string)

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

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

type Opts

type Opts struct {
	CloseFallback Closer
	NotifySpped   NotifySpped
	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
	GetBytes(key string) []byte
	PutBytes(key string, value []byte)
	Close() error
}

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