config

package
v1.21.9 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvYeagerAddress   = "YEAGER_ADDRESS"
	EnvYeagerTransport = "YEAGER_TRANSPORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Inbounds  Inbounds        `json:"inbounds,omitempty"`  // 入站代理
	Outbounds []*YeagerClient `json:"outbounds,omitempty"` // 出站代理
	Rules     []string        `json:"rules,omitempty"`     // 路由规则

	// developer only
	Debug bool `json:"debug,omitempty"`
	// 如何预估连接池大小,参考 proxy/yeager/transport/grpc/pool.go
	GrpcChannelPoolSize int `json:"grpcChannelPoolSize,omitempty"`
}

func C added in v1.20.0

func C() Config

func Load added in v1.21.9

func Load(r io.Reader) (Config, error)

Load read config from reader, and update the global config instance

type Inbounds

type Inbounds struct {
	SOCKS *struct {
		Listen string `json:"listen"`
	} `json:"socks,omitempty"`

	HTTP *struct {
		Listen string `json:"listen"`
	} `json:"http,omitempty"`

	Yeager *YeagerServer `json:"yeager,omitempty"`
}

type MutualTLS added in v1.20.7

type MutualTLS struct {
	CertFile string `json:"certFile"`
	CertPEM  []byte `json:"-"`
	KeyFile  string `json:"keyFile"`
	KeyPEM   []byte `json:"-"`
	CAFile   string `json:"caFile"`
	CAPEM    []byte `json:"-"`
}

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"`     // 出站标记,用于路由规则指定出站代理
	Address   string    `json:"address"` // server address to be connected
	Transport Transport `json:"transport"`
	MutualTLS MutualTLS `json:"mtls,omitempty"` // unavailable when transport is tcp
}

type YeagerServer

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

Jump to

Keyboard shortcuts

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