config

package
v1.19.31-hako.2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StartupProbe func(section string)

Functions

func Init

func Init(dir string) error

Init prepare necessary files

Types

type Config

type Config struct {
	General       *General
	Controller    *Controller
	Experimental  *Experimental
	IPTables      *IPTables
	NTP           *NTP
	DNS           *DNS
	Hosts         *trie.DomainTrie[resolver.HostValue]
	Profile       *Profile
	Rules         []C.Rule
	SubRules      map[string][]C.Rule
	Users         []auth.AuthUser
	Proxies       map[string]C.Proxy
	Listeners     map[string]C.InboundListener
	Providers     map[string]P.ProxyProvider
	RuleProviders map[string]P.RuleProvider
	Tunnels       []LC.Tunnel
	Sniffer       *sniffer.Config
	TLS           *TLS
}

Config is mihomo config manager

func Parse

func Parse(buf []byte) (*Config, error)

Parse config

func ParseRawConfig

func ParseRawConfig(rawCfg *RawConfig) (*Config, error)

type Controller

type Controller struct {
	ExternalController            string
	ExternalControllerTLS         string
	ExternalControllerUnix        string
	ExternalControllerPipe        string
	ExternalControllerRoutingMark int
	ExternalUI                    string
	ExternalUIURL                 string
	ExternalUIName                string
	ExternalDohServer             string
	Secret                        string
	Cors                          Cors
}

Controller config

type Cors

type Cors struct {
	AllowOrigins        []string
	AllowPrivateNetwork bool
}

type DNS

type DNS struct {
	Enable                bool
	PreferH3              bool
	IPv6                  bool
	IPv6Timeout           uint
	UseHosts              bool
	UseSystemHosts        bool
	NameServer            []dns.NameServer
	Fallback              []dns.NameServer
	FallbackIPFilter      []C.IpMatcher
	FallbackDomainFilter  []C.DomainMatcher
	FallbackLazyQuery     bool
	Listen                string
	ListenRoutingMark     int
	EnhancedMode          C.DNSMode
	DefaultNameserver     []dns.NameServer
	CacheAlgorithm        string
	CacheMaxSize          int
	FakeIPRange           netip.Prefix
	FakeIPPool            *fakeip.Pool
	FakeIPRange6          netip.Prefix
	FakeIPPool6           *fakeip.Pool
	FakeIPSkipper         *fakeip.Skipper
	FakeIPTTL             int
	NameServerPolicy      []dns.Policy
	ProxyServerNameserver []dns.NameServer
	ProxyServerPolicy     []dns.Policy
	DirectNameServer      []dns.NameServer
	DirectFollowPolicy    bool
}

DNS config

type Experimental

type Experimental struct {
	QUICGoDisableGSO bool
	QUICGoDisableECN bool
	IP4PEnable       bool
}

Experimental config

type General

type General struct {
	Inbound
	Mode                T.TunnelMode            `json:"mode"`
	UnifiedDelay        bool                    `json:"unified-delay"`
	LogLevel            log.LogLevel            `json:"log-level"`
	IPv6                bool                    `json:"ipv6"`
	Interface           string                  `json:"interface-name"`
	RoutingMark         int                     `json:"routing-mark"`
	GeoXUrl             GeoXUrl                 `json:"geox-url"`
	GeoAutoUpdate       bool                    `json:"geo-auto-update"`
	GeoUpdateInterval   int                     `json:"geo-update-interval"`
	GeodataMode         bool                    `json:"geodata-mode"`
	GeodataLoader       string                  `json:"geodata-loader"`
	GeositeMatcher      string                  `json:"geosite-matcher"`
	TCPConcurrent       bool                    `json:"tcp-concurrent"`
	FindProcessMode     process.FindProcessMode `json:"find-process-mode"`
	Sniffing            bool                    `json:"sniffing"`
	GlobalUA            string                  `json:"global-ua"`
	ETagSupport         bool                    `json:"etag-support"`
	KeepAliveIdle       int                     `json:"keep-alive-idle"`
	KeepAliveInterval   int                     `json:"keep-alive-interval"`
	DisableKeepAlive    bool                    `json:"disable-keep-alive"`
	NetworkStrategy     string                  `json:"network-strategy"`
	NetworkType         []string                `json:"network-type"`
	FallbackNetworkType []string                `json:"fallback-network-type"`
}

General config

type GeoXUrl

type GeoXUrl struct {
	GeoIp   string `json:"geo-ip"`
	Mmdb    string `json:"mmdb"`
	ASN     string `json:"asn"`
	GeoSite string `json:"geo-site"`
}

GeoXUrl config

type IPTables

type IPTables struct {
	Enable           bool
	InboundInterface string
	Bypass           []string
	DnsRedirect      bool
}

IPTables config

type Inbound

type Inbound struct {
	Port              int            `json:"port"`
	SocksPort         int            `json:"socks-port"`
	RedirPort         int            `json:"redir-port"`
	TProxyPort        int            `json:"tproxy-port"`
	MixedPort         int            `json:"mixed-port"`
	Tun               LC.Tun         `json:"tun"`
	TuicServer        LC.TuicServer  `json:"tuic-server"`
	ShadowSocksConfig string         `json:"ss-config"`
	VmessConfig       string         `json:"vmess-config"`
	Authentication    []string       `json:"authentication"`
	SkipAuthPrefixes  []netip.Prefix `json:"skip-auth-prefixes"`
	LanAllowedIPs     []netip.Prefix `json:"lan-allowed-ips"`
	LanDisAllowedIPs  []netip.Prefix `json:"lan-disallowed-ips"`
	AllowLan          bool           `json:"allow-lan"`
	BindAddress       string         `json:"bind-address"`
	InboundTfo        bool           `json:"inbound-tfo"`
	InboundMPTCP      bool           `json:"inbound-mptcp"`
}

Inbound config

type NTP

type NTP struct {
	Enable        bool
	Server        string
	Port          int
	Interval      int
	DialerProxy   string
	WriteToSystem bool
}

NTP config

type Profile

type Profile struct {
	StoreSelected bool
	StoreFakeIP   bool
}

Profile config

type RawClashForAndroid

type RawClashForAndroid struct {
	AppendSystemDNS   bool   `yaml:"append-system-dns" json:"append-system-dns"`
	UiSubtitlePattern string `yaml:"ui-subtitle-pattern" json:"ui-subtitle-pattern"`
}

type RawConfig

type RawConfig struct {
	PreserveTunIPv6               bool                    `yaml:"-" json:"-"`
	Port                          int                     `yaml:"port" json:"port"`
	SocksPort                     int                     `yaml:"socks-port" json:"socks-port"`
	RedirPort                     int                     `yaml:"redir-port" json:"redir-port"`
	TProxyPort                    int                     `yaml:"tproxy-port" json:"tproxy-port"`
	MixedPort                     int                     `yaml:"mixed-port" json:"mixed-port"`
	ShadowSocksConfig             string                  `yaml:"ss-config" json:"ss-config"`
	VmessConfig                   string                  `yaml:"vmess-config" json:"vmess-config"`
	InboundTfo                    bool                    `yaml:"inbound-tfo" json:"inbound-tfo"`
	InboundMPTCP                  bool                    `yaml:"inbound-mptcp" json:"inbound-mptcp"`
	Authentication                []string                `yaml:"authentication" json:"authentication"`
	SkipAuthPrefixes              []netip.Prefix          `yaml:"skip-auth-prefixes" json:"skip-auth-prefixes"`
	LanAllowedIPs                 []netip.Prefix          `yaml:"lan-allowed-ips" json:"lan-allowed-ips"`
	LanDisAllowedIPs              []netip.Prefix          `yaml:"lan-disallowed-ips" json:"lan-disallowed-ips"`
	AllowLan                      bool                    `yaml:"allow-lan" json:"allow-lan"`
	BindAddress                   string                  `yaml:"bind-address" json:"bind-address"`
	Mode                          T.TunnelMode            `yaml:"mode" json:"mode"`
	UnifiedDelay                  bool                    `yaml:"unified-delay" json:"unified-delay"`
	LogLevel                      log.LogLevel            `yaml:"log-level" json:"log-level"`
	IPv6                          bool                    `yaml:"ipv6" json:"ipv6"`
	ExternalController            string                  `yaml:"external-controller" json:"external-controller"`
	ExternalControllerRoutingMark int                     `yaml:"external-controller-routing-mark" json:"external-controller-routing-mark"`
	ExternalControllerPipe        string                  `yaml:"external-controller-pipe" json:"external-controller-pipe"`
	ExternalControllerUnix        string                  `yaml:"external-controller-unix" json:"external-controller-unix"`
	ExternalControllerTLS         string                  `yaml:"external-controller-tls" json:"external-controller-tls"`
	ExternalControllerCors        RawCors                 `yaml:"external-controller-cors" json:"external-controller-cors"`
	ExternalUI                    string                  `yaml:"external-ui" json:"external-ui"`
	ExternalUIURL                 string                  `yaml:"external-ui-url" json:"external-ui-url"`
	ExternalUIName                string                  `yaml:"external-ui-name" json:"external-ui-name"`
	ExternalDohServer             string                  `yaml:"external-doh-server" json:"external-doh-server"`
	Secret                        string                  `yaml:"secret" json:"secret"`
	Interface                     string                  `yaml:"interface-name" json:"interface-name"`
	RoutingMark                   int                     `yaml:"routing-mark" json:"routing-mark"`
	Tunnels                       []LC.Tunnel             `yaml:"tunnels" json:"tunnels"`
	GeoAutoUpdate                 bool                    `yaml:"geo-auto-update" json:"geo-auto-update"`
	GeoUpdateInterval             int                     `yaml:"geo-update-interval" json:"geo-update-interval"`
	GeodataMode                   bool                    `yaml:"geodata-mode" json:"geodata-mode"`
	GeodataLoader                 string                  `yaml:"geodata-loader" json:"geodata-loader"`
	GeositeMatcher                string                  `yaml:"geosite-matcher" json:"geosite-matcher"`
	TCPConcurrent                 bool                    `yaml:"tcp-concurrent" json:"tcp-concurrent"`
	FindProcessMode               process.FindProcessMode `yaml:"find-process-mode" json:"find-process-mode"`
	GlobalClientFingerprint       string                  `yaml:"global-client-fingerprint" json:"global-client-fingerprint"`
	GlobalUA                      string                  `yaml:"global-ua" json:"global-ua"`
	ETagSupport                   bool                    `yaml:"etag-support" json:"etag-support"`
	KeepAliveIdle                 int                     `yaml:"keep-alive-idle" json:"keep-alive-idle"`
	KeepAliveInterval             int                     `yaml:"keep-alive-interval" json:"keep-alive-interval"`
	DisableKeepAlive              bool                    `yaml:"disable-keep-alive" json:"disable-keep-alive"`
	NetworkStrategy               string                  `yaml:"network-strategy" json:"network-strategy"`
	NetworkType                   []string                `yaml:"network-type" json:"network-type"`
	FallbackNetworkType           []string                `yaml:"fallback-network-type" json:"fallback-network-type"`

	ProxyProvider map[string]map[string]any `yaml:"proxy-providers" json:"proxy-providers"`
	RuleProvider  map[string]map[string]any `yaml:"rule-providers" json:"rule-providers"`
	Proxy         []map[string]any          `yaml:"proxies" json:"proxies"`
	ProxyGroup    []map[string]any          `yaml:"proxy-groups" json:"proxy-groups"`
	Rule          []string                  `yaml:"rules" json:"rule"`
	SubRules      map[string][]string       `yaml:"sub-rules" json:"sub-rules"`
	Listeners     []map[string]any          `yaml:"listeners" json:"listeners"`
	Hosts         map[string]any            `yaml:"hosts" json:"hosts"`
	DNS           RawDNS                    `yaml:"dns" json:"dns"`
	NTP           RawNTP                    `yaml:"ntp" json:"ntp"`
	Tun           RawTun                    `yaml:"tun" json:"tun"`
	TuicServer    RawTuicServer             `yaml:"tuic-server" json:"tuic-server"`
	IPTables      RawIPTables               `yaml:"iptables" json:"iptables"`
	Experimental  RawExperimental           `yaml:"experimental" json:"experimental"`
	Profile       RawProfile                `yaml:"profile" json:"profile"`
	GeoXUrl       RawGeoXUrl                `yaml:"geox-url" json:"geox-url"`
	Sniffer       RawSniffer                `yaml:"sniffer" json:"sniffer"`
	TLS           RawTLS                    `yaml:"tls" json:"tls"`

	ClashForAndroid RawClashForAndroid `yaml:"clash-for-android" json:"clash-for-android"`
}

func DefaultRawConfig

func DefaultRawConfig() *RawConfig

func UnmarshalRawConfig

func UnmarshalRawConfig(buf []byte) (*RawConfig, error)

type RawCors

type RawCors struct {
	AllowOrigins        []string `yaml:"allow-origins" json:"allow-origins"`
	AllowPrivateNetwork bool     `yaml:"allow-private-network" json:"allow-private-network"`
}

type RawDNS

type RawDNS struct {
	Enable                       bool                                `yaml:"enable" json:"enable"`
	PreferH3                     bool                                `yaml:"prefer-h3" json:"prefer-h3"`
	IPv6                         bool                                `yaml:"ipv6" json:"ipv6"`
	IPv6Timeout                  uint                                `yaml:"ipv6-timeout" json:"ipv6-timeout"`
	UseHosts                     bool                                `yaml:"use-hosts" json:"use-hosts"`
	UseSystemHosts               bool                                `yaml:"use-system-hosts" json:"use-system-hosts"`
	RespectRules                 bool                                `yaml:"respect-rules" json:"respect-rules"`
	NameServer                   []string                            `yaml:"nameserver" json:"nameserver"`
	Fallback                     []string                            `yaml:"fallback" json:"fallback"`
	FallbackFilter               RawFallbackFilter                   `yaml:"fallback-filter" json:"fallback-filter"`
	FallbackLazyQuery            bool                                `yaml:"fallback-lazy-query" json:"fallback-lazy-query"`
	Listen                       string                              `yaml:"listen" json:"listen"`
	ListenRoutingMark            int                                 `yaml:"listen-routing-mark" json:"listen-routing-mark"`
	EnhancedMode                 C.DNSMode                           `yaml:"enhanced-mode" json:"enhanced-mode"`
	FakeIPRange                  string                              `yaml:"fake-ip-range" json:"fake-ip-range"`
	FakeIPRange6                 string                              `yaml:"fake-ip-range6" json:"fake-ip-range6"`
	FakeIPFilter                 []string                            `yaml:"fake-ip-filter" json:"fake-ip-filter"`
	FakeIPFilterMode             C.FilterMode                        `yaml:"fake-ip-filter-mode" json:"fake-ip-filter-mode"`
	FakeIPTTL                    int                                 `yaml:"fake-ip-ttl" json:"fake-ip-ttl"`
	DefaultNameserver            []string                            `yaml:"default-nameserver" json:"default-nameserver"`
	CacheAlgorithm               string                              `yaml:"cache-algorithm" json:"cache-algorithm"`
	CacheMaxSize                 int                                 `yaml:"cache-max-size" json:"cache-max-size"`
	NameServerPolicy             *orderedmap.OrderedMap[string, any] `yaml:"nameserver-policy" json:"nameserver-policy"`
	ProxyServerNameserver        []string                            `yaml:"proxy-server-nameserver" json:"proxy-server-nameserver"`
	ProxyServerNameserverPolicy  *orderedmap.OrderedMap[string, any] `yaml:"proxy-server-nameserver-policy" json:"proxy-server-nameserver-policy"`
	DirectNameServer             []string                            `yaml:"direct-nameserver" json:"direct-nameserver"`
	DirectNameServerFollowPolicy bool                                `yaml:"direct-nameserver-follow-policy" json:"direct-nameserver-follow-policy"`
}

type RawExperimental

type RawExperimental struct {
	Fingerprints     []string `yaml:"fingerprints" json:"fingerprints"`
	QUICGoDisableGSO bool     `yaml:"quic-go-disable-gso" json:"quic-go-disable-gso"`
	QUICGoDisableECN bool     `yaml:"quic-go-disable-ecn" json:"quic-go-disable-ecn"`
	IP4PEnable       bool     `yaml:"dialer-ip4p-convert" json:"dialer-ip4p-convert"`
}

type RawFallbackFilter

type RawFallbackFilter struct {
	GeoIP     bool     `yaml:"geoip" json:"geoip"`
	GeoIPCode string   `yaml:"geoip-code" json:"geoip-code"`
	IPCIDR    []string `yaml:"ipcidr" json:"ipcidr"`
	Domain    []string `yaml:"domain" json:"domain"`
	GeoSite   []string `yaml:"geosite" json:"geosite"`
}

type RawGeoXUrl

type RawGeoXUrl struct {
	GeoIp   string `yaml:"geoip" json:"geoip"`
	Mmdb    string `yaml:"mmdb" json:"mmdb"`
	ASN     string `yaml:"asn" json:"asn"`
	GeoSite string `yaml:"geosite" json:"geosite"`
}

type RawIPTables

type RawIPTables struct {
	Enable           bool     `yaml:"enable" json:"enable"`
	InboundInterface string   `yaml:"inbound-interface" json:"inbound-interface"`
	Bypass           []string `yaml:"bypass" json:"bypass"`
	DnsRedirect      bool     `yaml:"dns-redirect" json:"dns-redirect"`
}

type RawNTP

type RawNTP struct {
	Enable        bool   `yaml:"enable" json:"enable"`
	Server        string `yaml:"server" json:"server"`
	Port          int    `yaml:"port" json:"port"`
	Interval      int    `yaml:"interval" json:"interval"`
	DialerProxy   string `yaml:"dialer-proxy" json:"dialer-proxy"`
	WriteToSystem bool   `yaml:"write-to-system" json:"write-to-system"`
}

type RawProfile

type RawProfile struct {
	StoreSelected  bool `yaml:"store-selected" json:"store-selected"`
	StoreFakeIP    bool `yaml:"store-fake-ip" json:"store-fake-ip"`
	StoreFakeIPSet bool `yaml:"-" json:"-"`
}

func (*RawProfile) UnmarshalYAML

func (p *RawProfile) UnmarshalYAML(node *yaml.Node) error

type RawSniffer

type RawSniffer struct {
	Enable          bool     `yaml:"enable" json:"enable"`
	OverrideDest    bool     `yaml:"override-destination" json:"override-destination"`
	Sniffing        []string `yaml:"sniffing" json:"sniffing"`
	ForceDomain     []string `yaml:"force-domain" json:"force-domain"`
	SkipSrcAddress  []string `yaml:"skip-src-address" json:"skip-src-address"`
	SkipDstAddress  []string `yaml:"skip-dst-address" json:"skip-dst-address"`
	SkipDomain      []string `yaml:"skip-domain" json:"skip-domain"`
	Ports           []string `yaml:"port-whitelist" json:"port-whitelist"`
	ForceDnsMapping bool     `yaml:"force-dns-mapping" json:"force-dns-mapping"`
	ParsePureIp     bool     `yaml:"parse-pure-ip" json:"parse-pure-ip"`

	Sniff map[string]RawSniffingConfig `yaml:"sniff" json:"sniff"`
}

type RawSniffingConfig

type RawSniffingConfig struct {
	Ports        []string `yaml:"ports" json:"ports"`
	OverrideDest *bool    `yaml:"override-destination" json:"override-destination"`
}

type RawTLS

type RawTLS struct {
	Certificate     string   `yaml:"certificate" json:"certificate"`
	PrivateKey      string   `yaml:"private-key" json:"private-key"`
	ClientAuthType  string   `yaml:"client-auth-type" json:"client-auth-type"`
	ClientAuthCert  string   `yaml:"client-auth-cert" json:"client-auth-cert"`
	EchKey          string   `yaml:"ech-key" json:"ech-key"`
	CustomTrustCert []string `yaml:"custom-certifactes" json:"custom-certifactes"`
}

type RawTuicServer

type RawTuicServer struct {
	Enable                bool              `yaml:"enable" json:"enable"`
	Listen                string            `yaml:"listen" json:"listen"`
	Token                 []string          `yaml:"token" json:"token"`
	Users                 map[string]string `yaml:"users" json:"users,omitempty"`
	Certificate           string            `yaml:"certificate" json:"certificate"`
	PrivateKey            string            `yaml:"private-key" json:"private-key"`
	CongestionController  string            `yaml:"congestion-controller" json:"congestion-controller,omitempty"`
	MaxIdleTime           int               `yaml:"max-idle-time" json:"max-idle-time,omitempty"`
	AuthenticationTimeout int               `yaml:"authentication-timeout" json:"authentication-timeout,omitempty"`
	ALPN                  []string          `yaml:"alpn" json:"alpn,omitempty"`
	MaxUdpRelayPacketSize int               `yaml:"max-udp-relay-packet-size" json:"max-udp-relay-packet-size,omitempty"`
	CWND                  int               `yaml:"cwnd" json:"cwnd,omitempty"`
}

type RawTun

type RawTun struct {
	Enable              bool       `yaml:"enable" json:"enable"`
	Device              string     `yaml:"device" json:"device"`
	Stack               C.TUNStack `yaml:"stack" json:"stack"`
	DNSHijack           []string   `yaml:"dns-hijack" json:"dns-hijack"`
	AutoRoute           bool       `yaml:"auto-route" json:"auto-route"`
	AutoDetectInterface bool       `yaml:"auto-detect-interface" json:"auto-detect-interface"`

	MTU        uint32 `yaml:"mtu" json:"mtu,omitempty"`
	GSO        bool   `yaml:"gso" json:"gso,omitempty"`
	GSOMaxSize uint32 `yaml:"gso-max-size" json:"gso-max-size,omitempty"`
	//Inet4Address           []netip.Prefix `yaml:"inet4-address" json:"inet4-address,omitempty"`
	Inet6Address                          []netip.Prefix `yaml:"inet6-address" json:"inet6-address,omitempty"`
	IPRoute2TableIndex                    int            `yaml:"iproute2-table-index" json:"iproute2-table-index,omitempty"`
	IPRoute2RuleIndex                     int            `yaml:"iproute2-rule-index" json:"iproute2-rule-index,omitempty"`
	AutoRedirect                          bool           `yaml:"auto-redirect" json:"auto-redirect,omitempty"`
	AutoRedirectInputMark                 uint32         `yaml:"auto-redirect-input-mark" json:"auto-redirect-input-mark,omitempty"`
	AutoRedirectOutputMark                uint32         `yaml:"auto-redirect-output-mark" json:"auto-redirect-output-mark,omitempty"`
	AutoRedirectIPRoute2FallbackRuleIndex int            `yaml:"auto-redirect-iproute2-fallback-rule-index" json:"auto-redirect-iproute2-fallback-rule-index,omitempty"`
	LoopbackAddress                       []netip.Addr   `yaml:"loopback-address" json:"loopback-address,omitempty"`
	StrictRoute                           bool           `yaml:"strict-route" json:"strict-route,omitempty"`
	RouteAddress                          []netip.Prefix `yaml:"route-address" json:"route-address,omitempty"`
	RouteAddressSet                       []string       `yaml:"route-address-set" json:"route-address-set,omitempty"`
	RouteExcludeAddress                   []netip.Prefix `yaml:"route-exclude-address" json:"route-exclude-address,omitempty"`
	RouteExcludeAddressSet                []string       `yaml:"route-exclude-address-set" json:"route-exclude-address-set,omitempty"`
	IncludeInterface                      []string       `yaml:"include-interface" json:"include-interface,omitempty"`
	ExcludeInterface                      []string       `yaml:"exclude-interface" json:"exclude-interface,omitempty"`
	IncludeUID                            []uint32       `yaml:"include-uid" json:"include-uid,omitempty"`
	IncludeUIDRange                       []string       `yaml:"include-uid-range" json:"include-uid-range,omitempty"`
	ExcludeUID                            []uint32       `yaml:"exclude-uid" json:"exclude-uid,omitempty"`
	ExcludeUIDRange                       []string       `yaml:"exclude-uid-range" json:"exclude-uid-range,omitempty"`
	ExcludeSrcPort                        []uint16       `yaml:"exclude-src-port" json:"exclude-src-port,omitempty"`
	ExcludeSrcPortRange                   []string       `yaml:"exclude-src-port-range" json:"exclude-src-port-range,omitempty"`
	ExcludeDstPort                        []uint16       `yaml:"exclude-dst-port" json:"exclude-dst-port,omitempty"`
	ExcludeDstPortRange                   []string       `yaml:"exclude-dst-port-range" json:"exclude-dst-port-range,omitempty"`
	IncludeAndroidUser                    []int          `yaml:"include-android-user" json:"include-android-user,omitempty"`
	IncludePackage                        []string       `yaml:"include-package" json:"include-package,omitempty"`
	ExcludePackage                        []string       `yaml:"exclude-package" json:"exclude-package,omitempty"`
	IncludeMACAddress                     []string       `yaml:"include-mac-address" json:"include-mac-address,omitempty"`
	ExcludeMACAddress                     []string       `yaml:"exclude-mac-address" json:"exclude-mac-address,omitempty"`
	EndpointIndependentNat                bool           `yaml:"endpoint-independent-nat" json:"endpoint-independent-nat,omitempty"`
	UDPTimeout                            int64          `yaml:"udp-timeout" json:"udp-timeout,omitempty"`
	ICMPTimeout                           int64          `yaml:"icmp-timeout" json:"icmp-timeout,omitempty"`
	DisableICMPForwarding                 bool           `yaml:"disable-icmp-forwarding" json:"disable-icmp-forwarding,omitempty"`
	FileDescriptor                        int            `yaml:"file-descriptor" json:"file-descriptor"`

	Inet4RouteAddress        []netip.Prefix `yaml:"inet4-route-address" json:"inet4-route-address,omitempty"`
	Inet6RouteAddress        []netip.Prefix `yaml:"inet6-route-address" json:"inet6-route-address,omitempty"`
	Inet4RouteExcludeAddress []netip.Prefix `yaml:"inet4-route-exclude-address" json:"inet4-route-exclude-address,omitempty"`
	Inet6RouteExcludeAddress []netip.Prefix `yaml:"inet6-route-exclude-address" json:"inet6-route-exclude-address,omitempty"`

	// darwin special config
	RecvMsgX bool `yaml:"recvmsgx" json:"recvmsgx,omitempty"`
	SendMsgX bool `yaml:"sendmsgx" json:"sendmsgx,omitempty"`

	// gvisor special config (Non-public option; do not include it in the document.)
	ProcessorsPerChannel int `yaml:"processors-per-channel" json:"processors-per-channel,omitempty"`
}

type TLS

type TLS struct {
	Certificate     string
	PrivateKey      string
	ClientAuthType  string
	ClientAuthCert  string
	EchKey          string
	CustomTrustCert []string
}

TLS config

Jump to

Keyboard shortcuts

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