Documentation
¶
Index ¶
- func Init(dir string) error
- func ParseAuthentication(rawRecords []string) []auth.AuthUser
- func UpdateGeoDatabases() error
- type Config
- type Controller
- type DNS
- type EBpf
- type Experimental
- type FallbackFilter
- type General
- type LegacyInbound
- type Mitm
- type Profile
- type RawConfig
- type RawDNS
- type RawFallbackFilter
- type RawMitm
- type RawRule
- type Script
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseAuthentication ¶
func UpdateGeoDatabases ¶
func UpdateGeoDatabases() error
Types ¶
type Config ¶
type Config struct { General *General Mitm *Mitm DNS *DNS Experimental *Experimental Hosts *trie.DomainTrie[netip.Addr] Profile *Profile Inbounds []C.Inbound Rules []C.Rule RuleProviders map[string]C.Rule Users []auth.AuthUser Proxies map[string]C.Proxy Providers map[string]providerTypes.ProxyProvider MainMatcher C.Matcher Tunnels []Tunnel }
Config is clash config manager
func ParseRawConfig ¶
type Controller ¶
type Controller struct { ExternalController string `json:"-"` ExternalUI string `json:"-"` Secret string `json:"-"` PPROF bool `json:"-"` }
Controller config
type DNS ¶
type DNS struct { Enable bool `yaml:"enable"` IPv6 bool `yaml:"ipv6"` RemoteDnsResolve bool `yaml:"remote-dns-resolve"` NameServer []dns.NameServer `yaml:"nameserver"` Fallback []dns.NameServer `yaml:"fallback"` ProxyServerNameserver []dns.NameServer `yaml:"proxy-server-nameserver"` RemoteNameserver []dns.NameServer `yaml:"remote-nameserver"` FallbackFilter FallbackFilter `yaml:"fallback-filter"` Listen string `yaml:"listen"` EnhancedMode C.DNSMode `yaml:"enhanced-mode"` DefaultNameserver []dns.NameServer `yaml:"default-nameserver"` FakeIPRange *fakeip.Pool Hosts *trie.DomainTrie[netip.Addr] NameServerPolicy map[string]dns.NameServer SearchDomains []string }
DNS config
type EBpf ¶
type EBpf struct { RedirectToTun []string `yaml:"redirect-to-tun" json:"redirect-to-tun"` AutoRedir []string `yaml:"auto-redir" json:"auto-redir"` }
EBpf config
type Experimental ¶
type Experimental struct { UDPFallbackMatch bool `yaml:"udp-fallback-match"` UDPFallbackPolicy string `yaml:"udp-fallback-policy"` }
Experimental config
type FallbackFilter ¶
type FallbackFilter struct { GeoIP bool `yaml:"geoip"` GeoIPCode string `yaml:"geoip-code"` IPCIDR []*netip.Prefix `yaml:"ipcidr"` Domain []string `yaml:"domain"` GeoSite []*router.DomainMatcher `yaml:"geosite"` }
FallbackFilter config
type General ¶
type General struct { LegacyInbound Controller Authentication []string `json:"authentication"` Mode T.TunnelMode `json:"mode"` LogLevel L.LogLevel `json:"log-level"` IPv6 bool `json:"ipv6"` Sniffing bool `json:"sniffing"` Interface string `json:"-"` RoutingMark int `json:"-"` Tun C.Tun `json:"tun"` EBpf EBpf `json:"-"` }
General config
type LegacyInbound ¶
type LegacyInbound 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"` MitmPort int `json:"mitm-port"` AllowLan bool `json:"allow-lan"` BindAddress string `json:"bind-address"` }
LegacyInbound config
type Mitm ¶
type Mitm struct { Hosts *trie.DomainTrie[bool] `yaml:"hosts" json:"hosts"` Rules C.RewriteRule `yaml:"rules" json:"rules"` }
Mitm config
type Profile ¶
type Profile struct { StoreSelected bool `yaml:"store-selected"` StoreFakeIP bool `yaml:"store-fake-ip"` Tracing bool `yaml:"tracing"` }
Profile config
type RawConfig ¶
type RawConfig struct { Port int `yaml:"port"` SocksPort int `yaml:"socks-port"` RedirPort int `yaml:"redir-port"` TProxyPort int `yaml:"tproxy-port"` MixedPort int `yaml:"mixed-port"` MitmPort int `yaml:"mitm-port"` Authentication []string `yaml:"authentication"` AllowLan bool `yaml:"allow-lan"` BindAddress string `yaml:"bind-address"` Mode T.TunnelMode `yaml:"mode"` LogLevel L.LogLevel `yaml:"log-level"` IPv6 bool `yaml:"ipv6"` ExternalController string `yaml:"external-controller"` ExternalUI string `yaml:"external-ui"` Secret string `yaml:"secret"` PPROF bool `yaml:"pprof"` Interface string `yaml:"interface-name"` RoutingMark int `yaml:"routing-mark"` Sniffing bool `yaml:"sniffing"` ForceCertVerify bool `yaml:"force-cert-verify"` Tunnels []Tunnel `yaml:"tunnels"` ProxyProvider map[string]map[string]any `yaml:"proxy-providers"` Hosts map[string]string `yaml:"hosts"` Inbounds []C.Inbound `yaml:"inbounds"` DNS RawDNS `yaml:"dns"` Tun C.Tun `yaml:"tun"` MITM RawMitm `yaml:"mitm"` Experimental Experimental `yaml:"experimental"` Profile Profile `yaml:"profile"` Proxy []C.RawProxy `yaml:"proxies"` ProxyGroup []map[string]any `yaml:"proxy-groups"` Rule []RawRule `yaml:"rules"` Script Script `yaml:"script"` EBpf EBpf `yaml:"ebpf"` }
func UnmarshalRawConfig ¶
type RawDNS ¶
type RawDNS struct { Enable bool `yaml:"enable"` IPv6 *bool `yaml:"ipv6"` RemoteDnsResolve bool `yaml:"remote-dns-resolve"` UseHosts bool `yaml:"use-hosts"` NameServer []string `yaml:"nameserver"` Fallback []string `yaml:"fallback"` FallbackFilter RawFallbackFilter `yaml:"fallback-filter"` Listen string `yaml:"listen"` EnhancedMode C.DNSMode `yaml:"enhanced-mode"` FakeIPRange string `yaml:"fake-ip-range"` FakeIPFilter []string `yaml:"fake-ip-filter"` DefaultNameserver []string `yaml:"default-nameserver"` NameServerPolicy map[string]string `yaml:"nameserver-policy"` ProxyServerNameserver []string `yaml:"proxy-server-nameserver"` SearchDomains []string `yaml:"search-domains"` RemoteNameserver []string `yaml:"remote-nameserver"` }
type RawFallbackFilter ¶
Click to show internal directories.
Click to hide internal directories.