clash

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfConfigValid

func CheckIfConfigValid(content string) bool

func MergeRules

func MergeRules(oldRules []string, newRules []string) []string

MergeRules 合并追加新规则

Types

type ClashRawConfig

type ClashRawConfig struct {
	Port               int               `yaml:"port"`
	SocksPort          int               `yaml:"socks-port"`
	RedirPort          int               `yaml:"redir-port,omitempty"`
	TProxyPort         int               `yaml:"tproxy-port,omitempty"`
	MixedPort          int               `yaml:"mixed-port,omitempty"`
	Authentication     []string          `yaml:"authentication,omitempty"`
	AllowLan           bool              `yaml:"allow-lan"`
	BindAddress        string            `yaml:"bind-address,omitempty"`
	Mode               clashT.TunnelMode `yaml:"mode"`
	LogLevel           clashLog.LogLevel `yaml:"log-level"`
	IPv6               bool              `yaml:"ipv6,omitempty"`
	ExternalController string            `yaml:"external-controller"`
	ExternalUI         string            `yaml:"external-ui,omitempty"`
	Secret             string            `yaml:"secret,omitempty"`
	Interface          string            `yaml:"interface-name,omitempty"`
	RoutingMark        int               `yaml:"routing-mark,omitempty"`

	ProxyProvider map[string]map[string]any `yaml:"proxy-providers,omitempty"`
	Hosts         map[string]string         `yaml:"hosts,omitempty"`
	DNS           clashConfig.RawDNS        `yaml:"dns,omitempty"`
	Experimental  clashConfig.Experimental  `yaml:"experimental,omitempty"`
	Profile       clashConfig.Profile       `yaml:"profile,omitempty"`
	Proxy         []map[string]any          `yaml:"proxies"`
	ProxyGroup    []map[string]any          `yaml:"proxy-groups"`
	Rule          []string                  `yaml:"rules"`

	Tun *TunConfig `yaml:"tun,omitempty"`
}

func UnmarshalClashRawConfig

func UnmarshalClashRawConfig(buf []byte) (*ClashRawConfig, error)

type TunConfig added in v1.0.3

type TunConfig struct {
	Enable              bool     `yaml:"enable"`
	Stack               string   `yaml:"stack"`
	AutoRoute           bool     `yaml:"auto-route"`
	AutoDetectInterface bool     `yaml:"auto-detect-interface"`
	DnsHijack           []string `yaml:"dns-hijack"`
}

Jump to

Keyboard shortcuts

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