config

package
v1.22.6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// 入站代理
	Inbounds Inbounds `json:"inbounds,omitempty" yaml:"inbounds,omitempty"`
	// 出站代理
	Outbounds []YeagerClient `json:"outbounds,omitempty" yaml:"outbounds,omitempty"`
	// 路由规则
	Rules []string `json:"rules,omitempty" yaml:"rules,omitempty"`
	// verbose logging
	Verbose bool `json:"verbose,omitempty" yaml:"verbose,omitempty"`
	// expose runtime metrics for debugging and profiling, developers only
	Debug bool `json:"debug,omitempty" yaml:"debug,omitempty"`
}

func Load added in v1.21.9

func Load(bs []byte) (Config, error)

Load read config from bytes

type HTTP added in v1.22.5

type HTTP struct {
	Listen string `json:"listen" yaml:"listen"`
}

type Inbounds

type Inbounds struct {
	SOCKS  *SOCKS        `json:"socks,omitempty" yaml:"socks,omitempty"`
	HTTP   *HTTP         `json:"http,omitempty" yaml:"http,omitempty"`
	Yeager *YeagerServer `json:"yeager,omitempty" yaml:"yeager,omitempty"`
}

type MutualTLS added in v1.20.7

type MutualTLS struct {
	CertFile string `json:"certFile" yaml:"certFile"`
	CertPEM  string `json:"certPEM,omitempty" yaml:"certPEM,omitempty"`
	KeyFile  string `json:"keyFile" yaml:"keyFile"`
	KeyPEM   string `json:"keyPEM,omitempty" yaml:"keyPEM,omitempty"`
	CAFile   string `json:"caFile" yaml:"caFile"`
	CAPEM    string `json:"caPEM,omitempty" yaml:"caPEM,omitempty"`
}

type SOCKS added in v1.22.5

type SOCKS struct {
	Listen string `json:"listen" yaml:"listen"`
}

type Transport

type Transport string
const (
	TransTCP  Transport = "tcp" // plain text
	TransGRPC Transport = "grpc"
	TransQUIC Transport = "quic"
)

type YeagerClient

type YeagerClient struct {
	Tag string `json:"tag" yaml:"tag"`
	// server address to be connected
	Address   string    `json:"address" yaml:"address"`
	Transport Transport `json:"transport" yaml:"transport"`
	// unavailable when transport is tcp
	MutualTLS MutualTLS `json:"mtls,omitempty" yaml:"mtls,omitempty"`

	// optional
	ConnectionPoolSize int `json:"connectionPoolSize,omitempty" yaml:"connectionPoolSize,omitempty"`
}

type YeagerServer

type YeagerServer struct {
	Listen    string    `json:"listen" yaml:"listen"`
	Transport Transport `json:"transport" yaml:"transport"`
	// unavailable when transport is tcp
	MutualTLS MutualTLS `json:"mtls,omitempty" yaml:"mtls,omitempty"`
}

Jump to

Keyboard shortcuts

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