conf

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiConfig

type ApiConfig struct {
	APIHost                  string             `yaml:"ApiHost"`
	NodeID                   int                `yaml:"NodeID"`
	Key                      string             `yaml:"ApiKey"`
	NodeType                 string             `yaml:"NodeType"`
	Timeout                  int                `yaml:"Timeout"`
	RuleListPath             string             `yaml:"RuleListPath"`
	CountryRestriction       bool               `yaml:"CountryRestriction"`
	CountryRestrictionConfig *RestrictionConfig `yaml:"CountryRestrictionConfig"`
}

type CertConfig

type CertConfig struct {
	CertMode         string            `yaml:"CertMode"` // none, file, http, dns
	RejectUnknownSni bool              `yaml:"RejectUnknownSni"`
	CertDomain       string            `yaml:"CertDomain"`
	CertFile         string            `yaml:"CertFile"`
	KeyFile          string            `yaml:"KeyFile"`
	Provider         string            `yaml:"Provider"` // alidns, cloudflare, gandi, godaddy....
	Email            string            `yaml:"Email"`
	DNSEnv           map[string]string `yaml:"DNSEnv"`
}

type Conf

type Conf struct {
	LogConfig          *LogConfig        `yaml:"Log"`
	DnsConfigPath      string            `yaml:"DnsConfigPath"`
	InboundConfigPath  string            `yaml:"InboundConfigPath"`
	OutboundConfigPath string            `yaml:"OutboundConfigPath"`
	RouteConfigPath    string            `yaml:"RouteConfigPath"`
	ConnectionConfig   *ConnectionConfig `yaml:"ConnectionConfig"`
	NodesConfig        []*NodeConfig     `yaml:"Nodes"`
}

func New

func New() *Conf

func (*Conf) LoadFromPath

func (p *Conf) LoadFromPath(filePath string) error

func (*Conf) Watch

func (p *Conf) Watch(filePath string, reload func()) error

type ConnectionConfig

type ConnectionConfig struct {
	Handshake    uint32 `yaml:"handshake"`
	ConnIdle     uint32 `yaml:"connIdle"`
	UplinkOnly   uint32 `yaml:"uplinkOnly"`
	DownlinkOnly uint32 `yaml:"downlinkOnly"`
	BufferSize   int32  `yaml:"bufferSize"`
}

func NewConnectionConfig

func NewConnectionConfig() *ConnectionConfig

type ControllerConfig

type ControllerConfig struct {
	ListenIP             string           `yaml:"ListenIP"`
	SendIP               string           `yaml:"SendIP"`
	EnableDNS            bool             `yaml:"EnableDNS"`
	DNSType              string           `yaml:"DNSType"`
	EnableVless          bool             `yaml:"EnableVless"`
	EnableXtls           bool             `json:"EnableXtls"`
	LimitConfig          LimitConfig      `yaml:"LimitConfig"`
	DisableUploadTraffic bool             `yaml:"DisableUploadTraffic"`
	DisableGetRule       bool             `yaml:"DisableGetRule"`
	EnableProxyProtocol  bool             `yaml:"EnableProxyProtocol"`
	DisableIVCheck       bool             `yaml:"DisableIVCheck"`
	DisableSniffing      bool             `yaml:"DisableSniffing"`
	EnableReality        bool             `yaml:"EnableReality"`
	RealityConfig        RealityConfig    `yaml:"RealityConfig"`
	EnableFallback       bool             `yaml:"EnableFallback"`
	FallBackConfigs      []FallBackConfig `yaml:"FallBackConfigs"`
	CertConfig           *CertConfig      `yaml:"CertConfig"`
}

type DynamicSpeedLimitConfig

type DynamicSpeedLimitConfig struct {
	Periodic   int   `yaml:"Periodic"`
	Traffic    int64 `yaml:"Traffic"`
	SpeedLimit int   `yaml:"SpeedLimit"`
	ExpireTime int   `yaml:"ExpireTime"`
}

type FallBackConfig

type FallBackConfig struct {
	SNI              string `yaml:"SNI"`
	Alpn             string `yaml:"Alpn"`
	Path             string `yaml:"Path"`
	Dest             string `yaml:"Dest"`
	ProxyProtocolVer uint64 `yaml:"ProxyProtocolVer"`
}

type IpReportConfig

type IpReportConfig struct {
	Periodic       int             `yaml:"Periodic"`
	Type           string          `yaml:"Type"`
	RecorderConfig *RecorderConfig `yaml:"RecorderConfig"`
	RedisConfig    *RedisConfig    `yaml:"RedisConfig"`
	EnableIpSync   bool            `yaml:"EnableIpSync"`
}

type LimitConfig

type LimitConfig struct {
	EnableRealtime          bool                     `yaml:"EnableRealtime"`
	SpeedLimit              int                      `yaml:"SpeedLimit"`
	IPLimit                 int                      `yaml:"DeviceLimit"`
	ConnLimit               int                      `yaml:"ConnLimit"`
	EnableIpRecorder        bool                     `yaml:"EnableIpRecorder"`
	IpRecorderConfig        *IpReportConfig          `yaml:"IpRecorderConfig"`
	EnableDynamicSpeedLimit bool                     `yaml:"EnableDynamicSpeedLimit"`
	DynamicSpeedLimitConfig *DynamicSpeedLimitConfig `yaml:"DynamicSpeedLimitConfig"`
}

type LogConfig

type LogConfig struct {
	Level      string `yaml:"Level"`
	AccessPath string `yaml:"AccessPath"`
	ErrorPath  string `yaml:"ErrorPath"`
}

func NewLogConfig

func NewLogConfig() *LogConfig

type NodeConfig

type NodeConfig struct {
	ApiConfig        *ApiConfig        `yaml:"ApiConfig"`
	ControllerConfig *ControllerConfig `yaml:"ControllerConfig"`
}

type RealityConfig

type RealityConfig struct {
	Dest         interface{} `yaml:"Dest"`
	Xver         uint64      `yaml:"Xver"`
	ServerNames  []string    `yaml:"ServerNames"`
	PrivateKey   string      `yaml:"PrivateKey"`
	MinClientVer string      `yaml:"MinClientVer"`
	MaxClientVer string      `yaml:"MaxClientVer"`
	MaxTimeDiff  uint64      `yaml:"MaxTimeDiff"`
	ShortIds     []string    `yaml:"ShortIds"`
}

type RecorderConfig

type RecorderConfig struct {
	Url     string `yaml:"Url"`
	Token   string `yaml:"Token"`
	Timeout int    `yaml:"Timeout"`
}

type RedisConfig

type RedisConfig struct {
	Address  string `yaml:"Address"`
	Password string `yaml:"Password"`
	Db       int    `yaml:"Db"`
	Expiry   int    `json:"Expiry"`
}

type RestrictionConfig

type RestrictionConfig struct {
	List        []string `yaml:"CountryList"`
	IpOtherList []string `yaml:"IpOtherList"`
}

Jump to

Keyboard shortcuts

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