config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2019 License: MIT Imports: 21 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(dir string) error

Init prepare necessary files

Types

type Config

type Config struct {
	General      *General
	DNS          *DNS
	Experimental *Experimental
	Rules        []C.Rule
	Proxies      map[string]C.Proxy
}

Config is clash config manager

func Parse added in v0.10.0

func Parse(path string) (*Config, error)

Parse config

type DNS added in v0.10.0

type DNS struct {
	Enable       bool             `yaml:"enable"`
	IPv6         bool             `yaml:"ipv6"`
	NameServer   []dns.NameServer `yaml:"nameserver"`
	Fallback     []dns.NameServer `yaml:"fallback"`
	Listen       string           `yaml:"listen"`
	EnhancedMode dns.EnhancedMode `yaml:"enhanced-mode"`
	FakeIPRange  *fakeip.Pool
}

DNS config

type Experimental added in v0.14.0

type Experimental struct {
	IgnoreResolveFail bool `yaml:"ignore-resolve-fail"`
}

Experimental config

type General

type General struct {
	Port               int          `json:"port"`
	SocksPort          int          `json:"socks-port"`
	RedirPort          int          `json:"redir-port"`
	AllowLan           bool         `json:"allow-lan"`
	Mode               T.Mode       `json:"mode"`
	LogLevel           log.LogLevel `json:"log-level"`
	ExternalController string       `json:"-"`
	ExternalUI         string       `json:"-"`
	Secret             string       `json:"-"`
}

General config

Jump to

Keyboard shortcuts

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