Unify parts of the model with MetaCubeX.

This commit is contained in:
2025-06-12 14:19:00 +10:00
parent 0c8bbac2e6
commit f88ae52a29
24 changed files with 590 additions and 353 deletions

View File

@ -1,16 +1,18 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/anytls.go
type Anytls struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
Password string `yaml:"password,omitempty"`
Alpn []string `yaml:"alpn,omitempty"`
Sni string `yaml:"sni,omitempty"`
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
UDP bool `yaml:"udp,omitempty"`
IdleSessionCheckInterval int `yaml:"idle-session-check-interval,omitempty"`
IdleSessionTimeout int `yaml:"idle-session-timeout,omitempty"`
MinIdleSession int `yaml:"min-idle-session,omitempty"`
Server string `yaml:"server"`
Port int `yaml:"port"`
Password string `yaml:"password"`
ALPN []string `yaml:"alpn,omitempty"`
SNI string `yaml:"sni,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
UDP bool `yaml:"udp,omitempty"`
IdleSessionCheckInterval int `yaml:"idle-session-check-interval,omitempty"`
IdleSessionTimeout int `yaml:"idle-session-timeout,omitempty"`
MinIdleSession int `yaml:"min-idle-session,omitempty"`
}

View File

@ -1,29 +1,29 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria.go
type Hysteria struct {
Server string `yaml:"server"`
Port int `yaml:"port,omitempty"`
Ports string `yaml:"ports,omitempty"`
Protocol string `yaml:"protocol,omitempty"`
ObfsProtocol string `yaml:"obfs-protocol,omitempty"`
Up string `yaml:"up"`
UpSpeed int `yaml:"up-speed,omitempty"`
Down string `yaml:"down"`
DownSpeed int `yaml:"down-speed,omitempty"`
Auth string `yaml:"auth,omitempty"`
AuthStringOLD string `yaml:"auth_str,omitempty"`
AuthString string `yaml:"auth-str,omitempty"`
Obfs string `yaml:"obfs,omitempty"`
SNI string `yaml:"sni,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
Alpn []string `yaml:"alpn,omitempty"`
CustomCA string `yaml:"ca,omitempty"`
CustomCAString string `yaml:"ca-str,omitempty"`
ReceiveWindowConn int `yaml:"recv-window-conn,omitempty"`
ReceiveWindow int `yaml:"recv-window,omitempty"`
DisableMTUDiscovery bool `yaml:"disable-mtu-discovery,omitempty"`
FastOpen bool `yaml:"fast-open,omitempty"`
HopInterval int `yaml:"hop-interval,omitempty"`
AllowInsecure bool `yaml:"allow-insecure,omitempty"`
Server string `yaml:"server"`
Port int `yaml:"port,omitempty"`
Ports string `yaml:"ports,omitempty"`
Protocol string `yaml:"protocol,omitempty"`
ObfsProtocol string `yaml:"obfs-protocol,omitempty"` // compatible with Stash
Up string `yaml:"up"`
UpSpeed int `yaml:"up-speed,omitempty"` // compatible with Stash
Down string `yaml:"down"`
DownSpeed int `yaml:"down-speed,omitempty"` // compatible with Stash
Auth string `yaml:"auth,omitempty"`
AuthString string `yaml:"auth-str,omitempty"`
Obfs string `yaml:"obfs,omitempty"`
SNI string `yaml:"sni,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
CustomCA string `yaml:"ca,omitempty"`
CustomCAString string `yaml:"ca-str,omitempty"`
ReceiveWindowConn int `yaml:"recv-window-conn,omitempty"`
ReceiveWindow int `yaml:"recv-window,omitempty"`
DisableMTUDiscovery bool `yaml:"disable-mtu-discovery,omitempty"`
FastOpen bool `yaml:"fast-open,omitempty"`
HopInterval int `yaml:"hop-interval,omitempty"`
}

View File

@ -1,22 +1,29 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/hysteria2.go
type Hysteria2 struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
Up string `yaml:"up,omitempty"`
Down string `yaml:"down,omitempty"`
Password string `yaml:"password,omitempty"`
Obfs string `yaml:"obfs,omitempty"`
ObfsPassword string `yaml:"obfs-password,omitempty"`
SNI string `yaml:"sni,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
CustomCA string `yaml:"ca,omitempty"`
CustomCAString string `yaml:"ca-str,omitempty"`
CWND int `yaml:"cwnd,omitempty"`
ObfsParam string `yaml:"obfs-param,omitempty"`
Sni string `yaml:"sni,omitempty"`
TLS bool `yaml:"tls,omitempty"`
Network string `yaml:"network,omitempty"`
Server string `yaml:"server"`
Port int `yaml:"port,omitempty"`
Ports string `yaml:"ports,omitempty"`
HopInterval int `yaml:"hop-interval,omitempty"`
Up string `yaml:"up,omitempty"`
Down string `yaml:"down,omitempty"`
Password string `yaml:"password,omitempty"`
Obfs string `yaml:"obfs,omitempty"`
ObfsPassword string `yaml:"obfs-password,omitempty"`
SNI string `yaml:"sni,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
CustomCA string `yaml:"ca,omitempty"`
CustomCAString string `yaml:"ca-str,omitempty"`
CWND int `yaml:"cwnd,omitempty"`
UdpMTU int `yaml:"udp-mtu,omitempty"`
// quic-go special config
InitialStreamReceiveWindow uint64 `yaml:"initial-stream-receive-window,omitempty"`
MaxStreamReceiveWindow uint64 `yaml:"max-stream-receive-window,omitempty"`
InitialConnectionReceiveWindow uint64 `yaml:"initial-connection-receive-window,omitempty"`
MaxConnectionReceiveWindow uint64 `yaml:"max-connection-receive-window,omitempty"`
}

View File

@ -42,6 +42,11 @@ type WireGuardPeerOption struct {
AllowedIPs []string `yaml:"allowed-ips,omitempty"`
}
type ECHOptions struct {
Enable bool `yaml:"enable,omitempty" obfs:"enable,omitempty"`
Config string `yaml:"config,omitempty" obfs:"config,omitempty"`
}
type Proxy struct {
Type string
Name string

View File

@ -1,5 +1,6 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocks.go
type ShadowSocks struct {
Server string `yaml:"server"`
Port int `yaml:"port"`

View File

@ -1,5 +1,6 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/shadowsocksr.go
type ShadowSocksR struct {
Server string `yaml:"server"`
Port int `yaml:"port"`

View File

@ -1,8 +1,13 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/socks5.go
type Socks struct {
Server string `yaml:"server,omitempty"`
Port int `yaml:"port,omitempty"`
Username string `yaml:"username,omitempty"`
Password string `yaml:"password,omitempty"`
Server string `yaml:"server"`
Port int `yaml:"port"`
UserName string `yaml:"username,omitempty"`
Password string `yaml:"password,omitempty"`
TLS bool `yaml:"tls,omitempty"`
UDP bool `yaml:"udp,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
}

View File

@ -1,18 +1,26 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/trojan.go
type Trojan struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
Password string `yaml:"password"`
Alpn []string `yaml:"alpn,omitempty"`
Sni string `yaml:"sni,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
SNI string `yaml:"sni,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
UDP bool `yaml:"udp,omitempty"`
Network string `yaml:"network,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
RealityOpts RealityOptions `yaml:"reality-opts,omitempty"`
GrpcOpts GrpcOptions `yaml:"grpc-opts,omitempty"`
WSOpts WSOptions `yaml:"ws-opts,omitempty"`
SSOpts TrojanSSOption `yaml:"ss-opts,omitempty"`
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
TLS bool `yaml:"tls,omitempty"`
}
type TrojanSSOption struct {
Enabled bool `yaml:"enabled,omitempty"`
Method string `yaml:"method,omitempty"`
Password string `yaml:"password,omitempty"`
}

View File

@ -1,17 +1,19 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vless.go
type Vless struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
UUID string `yaml:"uuid"`
Flow string `yaml:"flow,omitempty"`
TLS bool `yaml:"tls,omitempty"`
Alpn []string `yaml:"alpn,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
UDP bool `yaml:"udp,omitempty"`
PacketAddr bool `yaml:"packet-addr,omitempty"`
XUDP bool `yaml:"xudp,omitempty"`
PacketEncoding string `yaml:"packet-encoding,omitempty"`
Network string `yaml:"network,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
RealityOpts RealityOptions `yaml:"reality-opts,omitempty"`
HTTPOpts HTTPOptions `yaml:"http-opts,omitempty"`
HTTP2Opts HTTP2Options `yaml:"h2-opts,omitempty"`
@ -23,7 +25,4 @@ type Vless struct {
Fingerprint string `yaml:"fingerprint,omitempty"`
ServerName string `yaml:"servername,omitempty"`
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
Sni string `yaml:"sni,omitempty"`
AllowInsecure bool `yaml:"allow-insecure,omitempty"`
Servername string `yaml:"servername,omitempty"`
}

View File

@ -1,5 +1,6 @@
package proxy
// https://github.com/MetaCubeX/mihomo/blob/Meta/adapter/outbound/vmess.go
type Vmess struct {
Server string `yaml:"server"`
Port int `yaml:"port"`
@ -9,10 +10,11 @@ type Vmess struct {
UDP bool `yaml:"udp,omitempty"`
Network string `yaml:"network,omitempty"`
TLS bool `yaml:"tls,omitempty"`
Alpn []string `yaml:"alpn,omitempty"`
ALPN []string `yaml:"alpn,omitempty"`
SkipCertVerify bool `yaml:"skip-cert-verify,omitempty"`
Fingerprint string `yaml:"fingerprint,omitempty"`
ServerName string `yaml:"servername,omitempty"`
ECHOpts ECHOptions `yaml:"ech-opts,omitempty"`
RealityOpts RealityOptions `yaml:"reality-opts,omitempty"`
HTTPOpts HTTPOptions `yaml:"http-opts,omitempty"`
HTTP2Opts HTTP2Options `yaml:"h2-opts,omitempty"`
@ -24,5 +26,4 @@ type Vmess struct {
GlobalPadding bool `yaml:"global-padding,omitempty"`
AuthenticatedLength bool `yaml:"authenticated-length,omitempty"`
ClientFingerprint string `yaml:"client-fingerprint,omitempty"`
Servername string `yaml:"servername,omitempty"`
}

View File

@ -1,212 +1,83 @@
package model
import "github.com/bestnite/sub2clash/model/proxy"
import (
"net/netip"
"github.com/bestnite/sub2clash/model/proxy"
C "github.com/metacubex/mihomo/config"
LC "github.com/metacubex/mihomo/listener/config"
)
type NodeList struct {
Proxies []proxy.Proxy `yaml:"proxies,omitempty"`
Proxy []proxy.Proxy `yaml:"proxies,omitempty" json:"proxies"`
}
// https://github.com/MetaCubeX/mihomo/blob/Meta/config/config.go RawConfig
type Subscription struct {
Port int `yaml:"port,omitempty" json:"port"`
SocksPort int `yaml:"socks-port,omitempty" json:"socks-port"`
RedirPort int `yaml:"redir-port,omitempty" json:"redir-port"`
TProxyPort int `yaml:"tproxy-port,omitempty" json:"tproxy-port"`
MixedPort int `yaml:"mixed-port,omitempty" json:"mixed-port"`
ShadowSocksConfig string `yaml:"ss-config,omitempty"`
VmessConfig string `yaml:"vmess-config,omitempty"`
InboundTfo bool `yaml:"inbound-tfo,omitempty"`
InboundMPTCP bool `yaml:"inbound-mptcp,omitempty"`
Authentication []string `yaml:"authentication,omitempty" json:"authentication"`
SkipAuthPrefixes []string `yaml:"skip-auth-prefixes,omitempty"`
LanAllowedIPs []string `yaml:"lan-allowed-ips,omitempty"`
LanDisAllowedIPs []string `yaml:"lan-disallowed-ips,omitempty"`
AllowLan bool `yaml:"allow-lan,omitempty" json:"allow-lan"`
BindAddress string `yaml:"bind-address,omitempty" json:"bind-address"`
Mode string `yaml:"mode,omitempty" json:"mode"`
UnifiedDelay bool `yaml:"unified-delay,omitempty" json:"unified-delay"`
LogLevel string `yaml:"log-level,omitempty" json:"log-level"`
IPv6 bool `yaml:"ipv6,omitempty" json:"ipv6"`
ExternalController string `yaml:"external-controller,omitempty"`
ExternalControllerTLS string `yaml:"external-controller-tls,omitempty"`
ExternalUI string `yaml:"external-ui,omitempty"`
ExternalUIURL string `yaml:"external-ui-url,omitempty" json:"external-ui-url"`
ExternalUIName string `yaml:"external-ui-name,omitempty" json:"external-ui-name"`
Secret string `yaml:"secret,omitempty"`
Interface string `yaml:"interface-name,omitempty"`
RoutingMark int `yaml:"routing-mark,omitempty"`
//Tunnels []LC.Tunnel `yaml:"tunnels,omitempty"`
GeoAutoUpdate bool `yaml:"geo-auto-update,omitempty" json:"geo-auto-update"`
GeoUpdateInterval int `yaml:"geo-update-interval,omitempty" json:"geo-update-interval"`
GeodataMode bool `yaml:"geodata-mode,omitempty" json:"geodata-mode"`
GeodataLoader string `yaml:"geodata-loader,omitempty" json:"geodata-loader"`
GeositeMatcher string `yaml:"geosite-matcher,omitempty" json:"geosite-matcher"`
TCPConcurrent bool `yaml:"tcp-concurrent,omitempty" json:"tcp-concurrent"`
FindProcessMode string `yaml:"find-process-mode,omitempty" json:"find-process-mode"`
GlobalClientFingerprint string `yaml:"global-client-fingerprint,omitempty"`
GlobalUA string `yaml:"global-ua,omitempty"`
KeepAliveInterval int `yaml:"keep-alive-interval,omitempty"`
Port int `yaml:"port,omitempty" json:"port"`
SocksPort int `yaml:"socks-port,omitempty" json:"socks-port"`
RedirPort int `yaml:"redir-port,omitempty" json:"redir-port"`
TProxyPort int `yaml:"tproxy-port,omitempty" json:"tproxy-port"`
MixedPort int `yaml:"mixed-port,omitempty" json:"mixed-port"`
ShadowSocksConfig string `yaml:"ss-config,omitempty" json:"ss-config"`
VmessConfig string `yaml:"vmess-config,omitempty" json:"vmess-config"`
InboundTfo bool `yaml:"inbound-tfo,omitempty" json:"inbound-tfo"`
InboundMPTCP bool `yaml:"inbound-mptcp,omitempty" json:"inbound-mptcp"`
Authentication []string `yaml:"authentication,omitempty" json:"authentication"`
SkipAuthPrefixes []netip.Prefix `yaml:"skip-auth-prefixes,omitempty" json:"skip-auth-prefixes"`
LanAllowedIPs []netip.Prefix `yaml:"lan-allowed-ips,omitempty" json:"lan-allowed-ips"`
LanDisAllowedIPs []netip.Prefix `yaml:"lan-disallowed-ips,omitempty" json:"lan-disallowed-ips"`
AllowLan bool `yaml:"allow-lan,omitempty" json:"allow-lan"`
BindAddress string `yaml:"bind-address,omitempty" json:"bind-address"`
Mode string `yaml:"mode,omitempty" json:"mode"`
UnifiedDelay bool `yaml:"unified-delay,omitempty" json:"unified-delay"`
LogLevel string `yaml:"log-level,omitempty" json:"log-level"`
IPv6 bool `yaml:"ipv6,omitempty" json:"ipv6"`
ExternalController string `yaml:"external-controller,omitempty" json:"external-controller"`
ExternalControllerPipe string `yaml:"external-controller-pipe,omitempty" json:"external-controller-pipe"`
ExternalControllerUnix string `yaml:"external-controller-unix,omitempty" json:"external-controller-unix"`
ExternalControllerTLS string `yaml:"external-controller-tls,omitempty" json:"external-controller-tls"`
ExternalControllerCors C.RawCors `yaml:"external-controller-cors,omitempty" json:"external-controller-cors"`
ExternalUI string `yaml:"external-ui,omitempty" json:"external-ui"`
ExternalUIURL string `yaml:"external-ui-url,omitempty" json:"external-ui-url"`
ExternalUIName string `yaml:"external-ui-name,omitempty" json:"external-ui-name"`
ExternalDohServer string `yaml:"external-doh-server,omitempty" json:"external-doh-server"`
Secret string `yaml:"secret,omitempty" json:"secret"`
Interface string `yaml:"interface-name,omitempty" json:"interface-name"`
RoutingMark int `yaml:"routing-mark,omitempty" json:"routing-mark"`
Tunnels []LC.Tunnel `yaml:"tunnels,omitempty" json:"tunnels"`
GeoAutoUpdate bool `yaml:"geo-auto-update,omitempty" json:"geo-auto-update"`
GeoUpdateInterval int `yaml:"geo-update-interval,omitempty" json:"geo-update-interval"`
GeodataMode bool `yaml:"geodata-mode,omitempty" json:"geodata-mode"`
GeodataLoader string `yaml:"geodata-loader,omitempty" json:"geodata-loader"`
GeositeMatcher string `yaml:"geosite-matcher,omitempty" json:"geosite-matcher"`
TCPConcurrent bool `yaml:"tcp-concurrent,omitempty" json:"tcp-concurrent"`
FindProcessMode string `yaml:"find-process-mode,omitempty" json:"find-process-mode"`
GlobalClientFingerprint string `yaml:"global-client-fingerprint,omitempty" json:"global-client-fingerprint"`
GlobalUA string `yaml:"global-ua,omitempty" json:"global-ua"`
ETagSupport bool `yaml:"etag-support,omitempty" json:"etag-support"`
KeepAliveIdle int `yaml:"keep-alive-idle,omitempty" json:"keep-alive-idle"`
KeepAliveInterval int `yaml:"keep-alive-interval,omitempty" json:"keep-alive-interval"`
DisableKeepAlive bool `yaml:"disable-keep-alive,omitempty" json:"disable-keep-alive"`
Sniffer RawSniffer `yaml:"sniffer,omitempty" json:"sniffer"`
ProxyProvider map[string]map[string]any `yaml:"proxy-providers,omitempty"`
RuleProviders map[string]RuleProvider `yaml:"rule-providers,omitempty"`
ProxyProvider map[string]map[string]any `yaml:"proxy-providers,omitempty" json:"proxy-providers"`
RuleProvider map[string]RuleProvider `yaml:"rule-providers,omitempty" json:"rule-providers"`
Proxy []proxy.Proxy `yaml:"proxies,omitempty" json:"proxies"`
ProxyGroup []ProxyGroup `yaml:"proxy-groups,omitempty" json:"proxy-groups"`
Rule []string `yaml:"rules,omitempty" json:"rule"`
SubRules map[string][]string `yaml:"sub-rules,omitempty" json:"sub-rules"`
Listeners []map[string]any `yaml:"listeners,omitempty" json:"listeners"`
Hosts map[string]any `yaml:"hosts,omitempty" json:"hosts"`
NTP RawNTP `yaml:"ntp,omitempty" json:"ntp"`
DNS RawDNS `yaml:"dns,omitempty" json:"dns"`
Tun RawTun `yaml:"tun,omitempty"`
TuicServer RawTuicServer `yaml:"tuic-server,omitempty"`
EBpf EBpf `yaml:"ebpf,omitempty"`
IPTables IPTables `yaml:"iptables,omitempty"`
Experimental Experimental `yaml:"experimental,omitempty"`
Profile Profile `yaml:"profile,omitempty"`
GeoXUrl GeoXUrl `yaml:"geox-url,omitempty"`
Proxies []proxy.Proxy `yaml:"proxies,omitempty"`
ProxyGroups []ProxyGroup `yaml:"proxy-groups,omitempty"`
Rules []string `yaml:"rules,omitempty"`
SubRules map[string][]string `yaml:"sub-rules,omitempty"`
RawTLS TLS `yaml:"tls,omitempty"`
Listeners []map[string]any `yaml:"listeners,omitempty"`
DNS C.RawDNS `yaml:"dns,omitempty" json:"dns"`
NTP C.RawNTP `yaml:"ntp,omitempty" json:"ntp"`
Tun C.RawTun `yaml:"tun,omitempty" json:"tun"`
TuicServer C.RawTuicServer `yaml:"tuic-server,omitempty" json:"tuic-server"`
IPTables C.RawIPTables `yaml:"iptables,omitempty" json:"iptables"`
Experimental C.RawExperimental `yaml:"experimental,omitempty" json:"experimental"`
Profile C.RawProfile `yaml:"profile,omitempty" json:"profile"`
GeoXUrl C.RawGeoXUrl `yaml:"geox-url,omitempty" json:"geox-url"`
Sniffer C.RawSniffer `yaml:"sniffer,omitempty" json:"sniffer"`
TLS C.RawTLS `yaml:"tls,omitempty" json:"tls"`
ClashForAndroid RawClashForAndroid `yaml:"clash-for-android,omitempty" json:"clash-for-android"`
}
type RawClashForAndroid struct {
AppendSystemDNS bool `yaml:"append-system-dns,omitempty" json:"append-system-dns"`
UiSubtitlePattern string `yaml:"ui-subtitle-pattern,omitempty" json:"ui-subtitle-pattern"`
}
type TLS struct {
Certificate string `yaml:"certificate,omitempty"`
PrivateKey string `yaml:"private-key,omitempty"`
CustomTrustCert []string `yaml:"custom-certifactes,omitempty"`
}
type GeoXUrl struct {
GeoIp string `yaml:"geoip,omitempty" json:"geoip"`
Mmdb string `yaml:"mmdb,omitempty" json:"mmdb"`
GeoSite string `yaml:"geosite,omitempty" json:"geosite"`
}
type Experimental struct {
Fingerprints []string `yaml:"fingerprints,omitempty"`
QUICGoDisableGSO bool `yaml:"quic-go-disable-gso,omitempty"`
QUICGoDisableECN bool `yaml:"quic-go-disable-ecn,omitempty"`
IP4PEnable bool `yaml:"dialer-ip4p-convert,omitempty"`
}
type Profile struct {
StoreSelected bool `yaml:"store-selected,omitempty"`
StoreFakeIP bool `yaml:"store-fake-ip,omitempty"`
}
type IPTables struct {
Enable bool `yaml:"enable,omitempty" json:"enable"`
InboundInterface string `yaml:"inbound-interface,omitempty" json:"inbound-interface"`
Bypass []string `yaml:"bypass,omitempty" json:"bypass"`
DnsRedirect bool `yaml:"dns-redirect,omitempty" json:"dns-redirect"`
}
type EBpf struct {
RedirectToTun []string `yaml:"redirect-to-tun,omitempty" json:"redirect-to-tun"`
AutoRedir []string `yaml:"auto-redir,omitempty" json:"auto-redir"`
}
type RawSniffer struct {
Enable bool `yaml:"enable,omitempty" json:"enable"`
OverrideDest bool `yaml:"override-destination,omitempty" json:"override-destination"`
Sniffing []string `yaml:"sniffing,omitempty" json:"sniffing"`
ForceDomain []string `yaml:"force-domain,omitempty" json:"force-domain"`
SkipDomain []string `yaml:"skip-domain,omitempty" json:"skip-domain"`
Ports []string `yaml:"port-whitelist,omitempty" json:"port-whitelist"`
ForceDnsMapping bool `yaml:"force-dns-mapping,omitempty" json:"force-dns-mapping"`
ParsePureIp bool `yaml:"parse-pure-ip,omitempty" json:"parse-pure-ip"`
Sniff map[string]RawSniffingConfig `yaml:"sniff,omitempty" json:"sniff"`
}
type RawSniffingConfig struct {
Ports []string `yaml:"ports,omitempty" json:"ports"`
OverrideDest *bool `yaml:"override-destination,omitempty" json:"override-destination"`
}
type RawNTP struct {
Enable bool `yaml:"enable,omitempty"`
Server string `yaml:"server,omitempty"`
ServerPort int `yaml:"server-port,omitempty"`
Interval int `yaml:"interval,omitempty"`
DialerProxy string `yaml:"dialer-proxy,omitempty"`
WriteToSystem bool `yaml:"write-to-system,omitempty"`
}
type RawDNS struct {
Enable bool `yaml:"enable,omitempty" json:"enable"`
PreferH3 bool `yaml:"prefer-h3,omitempty" json:"prefer-h3"`
IPv6 bool `yaml:"ipv6,omitempty" json:"ipv6"`
IPv6Timeout uint `yaml:"ipv6-timeout,omitempty" json:"ipv6-timeout"`
UseHosts bool `yaml:"use-hosts,omitempty" json:"use-hosts"`
NameServer []string `yaml:"nameserver,omitempty" json:"nameserver"`
Fallback []string `yaml:"fallback,omitempty" json:"fallback"`
FallbackFilter RawFallbackFilter `yaml:"fallback-filter,omitempty" json:"fallback-filter"`
Listen string `yaml:"listen,omitempty" json:"listen"`
EnhancedMode string `yaml:"enhanced-mode,omitempty" json:"enhanced-mode"`
FakeIPRange string `yaml:"fake-ip-range,omitempty" json:"fake-ip-range"`
FakeIPFilter []string `yaml:"fake-ip-filter,omitempty" json:"fake-ip-filter"`
DefaultNameserver []string `yaml:"default-nameserver,omitempty" json:"default-nameserver"`
CacheAlgorithm string `yaml:"cache-algorithm,omitempty" json:"cache-algorithm"`
//NameServerPolicy *orderedmap.OrderedMap[string, any] `yaml:"nameserver-policy,omitempty" json:"nameserver-policy"`
ProxyServerNameserver []string `yaml:"proxy-server-nameserver,omitempty" json:"proxy-server-nameserver"`
}
type RawFallbackFilter struct {
GeoIP bool `yaml:"geoip,omitempty" json:"geoip"`
GeoIPCode string `yaml:"geoip-code,omitempty" json:"geoip-code"`
IPCIDR []string `yaml:"ipcidr,omitempty" json:"ipcidr"`
Domain []string `yaml:"domain,omitempty" json:"domain"`
GeoSite []string `yaml:"geosite,omitempty" json:"geosite"`
}
type RawTun struct {
Enable bool `yaml:"enable,omitempty" json:"enable"`
Device string `yaml:"device,omitempty" json:"device"`
Stack string `yaml:"stack,omitempty" json:"stack"`
DNSHijack []string `yaml:"dns-hijack,omitempty" json:"dns-hijack"`
AutoRoute bool `yaml:"auto-route,omitempty" json:"auto-route"`
AutoDetectInterface bool `yaml:"auto-detect-interface,omitempty"`
RedirectToTun []string `yaml:"-,omitempty" json:"-"`
MTU uint32 `yaml:"mtu,omitempty" json:"mtu,omitempty"`
GSO bool `yaml:"gso,omitempty" json:"gso,omitempty"`
GSOMaxSize uint32 `yaml:"gso-max-size,omitempty" json:"gso-max-size,omitempty"`
//Inet4Address []netip.Prefix `yaml:"inet4-address,omitempty" json:"inet4_address,omitempty"`
Inet6Address []uint32 `yaml:"inet6-address,omitempty" json:"inet6_address,omitempty"`
StrictRoute bool `yaml:"strict-route,omitempty" json:"strict_route,omitempty"`
Inet4RouteAddress []uint32 `yaml:"inet4-route-address,omitempty" json:"inet4_route_address,omitempty"`
Inet6RouteAddress []uint32 `yaml:"inet6-route-address,omitempty" json:"inet6_route_address,omitempty"`
Inet4RouteExcludeAddress []uint32 `yaml:"inet4-route-exclude-address,omitempty" json:"inet4_route_exclude_address,omitempty"`
Inet6RouteExcludeAddress []uint32 `yaml:"inet6-route-exclude-address,omitempty" json:"inet6_route_exclude_address,omitempty"`
IncludeInterface []string `yaml:"include-interface,omitempty" json:"include-interface,omitempty"`
ExcludeInterface []string `yaml:"exclude-interface,omitempty" json:"exclude-interface,omitempty"`
IncludeUID []uint32 `yaml:"include-uid,omitempty" json:"include_uid,omitempty"`
IncludeUIDRange []string `yaml:"include-uid-range,omitempty" json:"include_uid_range,omitempty"`
ExcludeUID []uint32 `yaml:"exclude-uid,omitempty" json:"exclude_uid,omitempty"`
ExcludeUIDRange []string `yaml:"exclude-uid-range,omitempty" json:"exclude_uid_range,omitempty"`
IncludeAndroidUser []int `yaml:"include-android-user,omitempty" json:"include_android_user,omitempty"`
IncludePackage []string `yaml:"include-package,omitempty" json:"include_package,omitempty"`
ExcludePackage []string `yaml:"exclude-package,omitempty" json:"exclude_package,omitempty"`
EndpointIndependentNat bool `yaml:"endpoint-independent-nat,omitempty" json:"endpoint_independent_nat,omitempty"`
UDPTimeout int64 `yaml:"udp-timeout,omitempty" json:"udp_timeout,omitempty"`
FileDescriptor int `yaml:"file-descriptor,omitempty" json:"file-descriptor"`
}
type RawTuicServer struct {
Enable bool `yaml:"enable,omitempty" json:"enable"`
Listen string `yaml:"listen,omitempty" json:"listen"`
Token []string `yaml:"token,omitempty" json:"token"`
Users map[string]string `yaml:"users,omitempty" json:"users,omitempty"`
Certificate string `yaml:"certificate,omitempty" json:"certificate"`
PrivateKey string `yaml:"private-key,omitempty" json:"private-key"`
CongestionController string `yaml:"congestion-controller,omitempty" json:"congestion-controller,omitempty"`
MaxIdleTime int `yaml:"max-idle-time,omitempty" json:"max-idle-time,omitempty"`
AuthenticationTimeout int `yaml:"authentication-timeout,omitempty" json:"authentication-timeout,omitempty"`
ALPN []string `yaml:"alpn,omitempty" json:"alpn,omitempty"`
MaxUdpRelayPacketSize int `yaml:"max-udp-relay-packet-size,omitempty" json:"max-udp-relay-packet-size,omitempty"`
CWND int `yaml:"cwnd,omitempty" json:"cwnd,omitempty"`
ClashForAndroid C.RawClashForAndroid `yaml:"clash-for-android,omitempty" json:"clash-for-android"`
}