config

package
v0.0.0-...-280623b Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 23 Imported by: 1

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
	Hosts        *trie.Trie
	Rules        []C.Rule
	Users        []auth.AuthUser
	Proxies      map[string]C.Proxy
}

Config is clash config manager

func Parse

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

Parse config

type DNS

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

DNS config

type Experimental

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

Experimental config

type FallbackFilter

type FallbackFilter struct {
	GeoIP  bool         `yaml:"geoip"`
	IPCIDR []*net.IPNet `yaml:"ipcidr"`
}

FallbackFilter config

type General

type General struct {
	Port               int          `json:"port"`
	SocksPort          int          `json:"socks-port"`
	RedirPort          int          `json:"redir-port"`
	Authentication     []string     `json:"authentication"`
	AllowLan           bool         `json:"allow-lan"`
	BindAddress        string       `json:"bind-address"`
	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