model

package
v0.0.12-beta.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CountryChineseName = map[string]string{}/* 258 elements not displayed */
View Source
var CountryEnglishName = map[string]string{}/* 253 elements not displayed */
View Source
var CountryFlag = map[string]string{}/* 259 elements not displayed */
View Source
var CountryISO = map[string]string{}/* 258 elements not displayed */

Functions

func GetSupportProxyTypes

func GetSupportProxyTypes(clashType ClashType) map[string]bool

Types

type ClashType

type ClashType int
const (
	Clash ClashType = 1 + iota
	ClashMeta
)

type EBpf

type EBpf struct {
	RedirectToTun []string `yaml:"redirect-to-tun,omitempty" json:"redirect-to-tun"`
	AutoRedir     []string `yaml:"auto-redir,omitempty" json:"auto-redir"`
}

type Experimental

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 GeoXUrl

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 IPTables

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 NodeList

type NodeList struct {
	Proxies []proxy.Proxy `yaml:"proxies,omitempty"`
}

type Payload

type Payload struct {
	Rules []string `yaml:"payload,omitempty"`
}

type Profile

type Profile struct {
	StoreSelected bool `yaml:"store-selected,omitempty"`
	StoreFakeIP   bool `yaml:"store-fake-ip,omitempty"`
}

type ProxyGroup

type ProxyGroup struct {
	Type                string   `yaml:"type,omitempty"`
	Name                string   `yaml:"name,omitempty"`
	Proxies             []string `yaml:"proxies,omitempty"`
	IsCountryGrop       bool     `yaml:"-"`
	Url                 string   `yaml:"url,omitempty"`
	Interval            int      `yaml:"interval,omitempty"`
	Tolerance           int      `yaml:"tolerance,omitempty"`
	Lazy                bool     `yaml:"lazy"`
	Size                int      `yaml:"-"`
	DisableUDP          bool     `yaml:"disable-udp,omitempty"`
	Strategy            string   `yaml:"strategy,omitempty"`
	Icon                string   `yaml:"icon,omitempty"`
	Timeout             int      `yaml:"timeout,omitempty"`
	Use                 []string `yaml:"use,omitempty"`
	InterfaceName       string   `yaml:"interface-name,omitempty"`
	RoutingMark         int      `yaml:"routing-mark,omitempty"`
	IncludeAll          bool     `yaml:"include-all,omitempty"`
	IncludeAllProxies   bool     `yaml:"include-all-proxies,omitempty"`
	IncludeAllProviders bool     `yaml:"include-all-providers,omitempty"`
	Filter              string   `yaml:"filter,omitempty"`
	ExcludeFilter       string   `yaml:"exclude-filter,omitempty"`
	ExpectedStatus      int      `yaml:"expected-status,omitempty"`
	Hidden              bool     `yaml:"hidden,omitempty"`
}

type ProxyGroupsSortByName

type ProxyGroupsSortByName []ProxyGroup

func (ProxyGroupsSortByName) Len

func (p ProxyGroupsSortByName) Len() int

func (ProxyGroupsSortByName) Less

func (p ProxyGroupsSortByName) Less(i, j int) bool

func (ProxyGroupsSortByName) Swap

func (p ProxyGroupsSortByName) Swap(i, j int)

type ProxyGroupsSortBySize

type ProxyGroupsSortBySize []ProxyGroup

func (ProxyGroupsSortBySize) Len

func (p ProxyGroupsSortBySize) Len() int

func (ProxyGroupsSortBySize) Less

func (p ProxyGroupsSortBySize) Less(i, j int) bool

func (ProxyGroupsSortBySize) Swap

func (p ProxyGroupsSortBySize) Swap(i, j int)

type RawClashForAndroid

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 RawDNS added in v1.1.1

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

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 RawNTP added in v1.1.1

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 RawSniffer added in v1.1.1

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

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

type RawTuicServer added in v1.1.1

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"`
}

type RawTun added in v1.1.1

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 RuleProvider

type RuleProvider struct {
	Type     string `yaml:"type,omitempty"`
	Behavior string `yaml:"behavior,omitempty"`
	Url      string `yaml:"url,omitempty"`
	Path     string `yaml:"path,omitempty"`
	Interval int    `yaml:"interval,omitempty"`
	Format   string `yaml:"format,omitempty"`
}

type RuleProviderStruct

type RuleProviderStruct struct {
	Behavior string
	Url      string
	Group    string
	Prepend  bool
	Name     string
}

type RuleStruct

type RuleStruct struct {
	Rule    string
	Prepend bool
}
type ShortLink struct {
	Hash            string
	Url             string
	Password        string
	LastRequestTime int64
}

type SubConfig

type SubConfig struct {
	Sub                 string               `form:"sub" binding:""`
	Subs                []string             `form:"-" binding:""`
	Proxy               string               `form:"proxy" binding:""`
	Proxies             []string             `form:"-" binding:""`
	Refresh             bool                 `form:"refresh,default=false" binding:""`
	Template            string               `form:"template" binding:""`
	RuleProvider        string               `form:"ruleProvider" binding:""`
	RuleProviders       []RuleProviderStruct `form:"-" binding:""`
	Rule                string               `form:"rule" binding:""`
	Rules               []RuleStruct         `form:"-" binding:""`
	AutoTest            bool                 `form:"autoTest,default=false" binding:""`
	Lazy                bool                 `form:"lazy,default=false" binding:""`
	Sort                string               `form:"sort" binding:""`
	Remove              string               `form:"remove" binding:""`
	Replace             string               `form:"replace" binding:""`
	ReplaceKeys         []string             `form:"-" binding:""`
	ReplaceTo           []string             `form:"-" binding:""`
	NodeListMode        bool                 `form:"nodeList,default=false" binding:""`
	IgnoreCountryGrooup bool                 `form:"ignoreCountryGroup,default=false" binding:""`
	UserAgent           string               `form:"userAgent" binding:""`
}

func ParseSubQuery

func ParseSubQuery(c *gin.Context) (SubConfig, error)

type Subscription

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"`

	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"`
	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"`

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

type TLS

type TLS struct {
	Certificate     string   `yaml:"certificate,omitempty"`
	PrivateKey      string   `yaml:"private-key,omitempty"`
	CustomTrustCert []string `yaml:"custom-certifactes,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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