clash

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseClashConfig

func ParseClashConfig(data []byte) (*sub.DecodeResult, error)

func ParseProxies

func ParseProxies(proxies []any) ([]*configs.OutboundHandlerConfig, []string, error)

ParseProxies converts a "proxies" array from a clash/mihomo config to vx-core OutboundHandlerConfigs

func ParseProxy

func ParseProxy(mapping map[string]any) (*configs.OutboundHandlerConfig, error)

ParseProxy converts a single mihomo proxy mapping to vx-core OutboundHandlerConfig

Types

type ClashConfig

type ClashConfig struct {
	Port               int        `yaml:"port"`
	SocksPort          int        `yaml:"socks-port"`
	AllowLan           bool       `yaml:"allow-lan"`
	Mode               string     `yaml:"mode"`
	LogLevel           string     `yaml:"log-level"`
	ExternalController string     `yaml:"external-controller"`
	DNS                *DNSConfig `yaml:"dns"`
	Proxies            []any      `yaml:"proxies"`
	ProxyGroups        []any      `yaml:"proxy-groups"`
	Rules              []string   `yaml:"rules"`
}

ClashConfig represents the structure of a Clash/Mihomo configuration file

type DNSConfig

type DNSConfig struct {
	Enable            bool     `yaml:"enable"`
	IPv6              bool     `yaml:"ipv6"`
	DefaultNameserver []string `yaml:"default-nameserver"`
	EnhancedMode      string   `yaml:"enhanced-mode"`
	FakeIPRange       string   `yaml:"fake-ip-range"`
	Nameserver        []string `yaml:"nameserver"`
	Fallback          []string `yaml:"fallback"`
}

Jump to

Keyboard shortcuts

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