config

package
v0.1.34 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadConfig

func ReadConfig(path string) ([]byte, error)

Types

type ClientConfig

type ClientConfig struct {
	ListenerConfig `yaml:",inline"`
	ProxyConfig    `yaml:",inline"`
	TargetAddress  string            `yaml:"target-address"`
	WSUrl          string            `yaml:"ws-url"`
	WSHeaders      map[string]string `yaml:"ws-headers"`
	SkipCertVerify bool              `yaml:"skip-cert-verify"`
	ServerName     string            `yaml:"servername"`
	ServerWSPath   string            `yaml:"server-ws-path"`
}

type Config

type Config struct {
	ServerConfigs []ServerConfig `yaml:"server"`
	ClientConfigs []ClientConfig `yaml:"client"`
	UdpConfigs    []UdpConfig    `yaml:"udp"`
	DisableServer bool           `yaml:"disable-server"`
	DisableClient bool           `yaml:"disable-client"`
	DisableUdp    bool           `yaml:"disable-udp"`
}

func ParseConfig

func ParseConfig(buf []byte) (*Config, error)

type FallbackConfig added in v0.1.31

type FallbackConfig struct {
	SshFallbackAddress     string `yaml:"ssh-fallback-address"`
	SshFallbackTimeout     int    `yaml:"ssh-fallback-timeout"`
	TLSFallbackAddress     string `yaml:"tls-fallback-address"` // old compatibility
	WSFallbackAddress      string `yaml:"ws-fallback-address"`
	UnknownFallbackAddress string `yaml:"unknown-fallback-address"`

	TLSFallback    []TLSFallbackConfig   `yaml:"tls-fallback"`
	QuicFallback   []QuicFallbackConfig  `yaml:"quic-fallback"`
	SSFallback     []SSFallbackConfig    `yaml:"ss-fallback"`
	SS2022Fallback []SSFallbackConfig    `yaml:"ss2022-fallback"`
	VmessFallback  []VmessFallbackConfig `yaml:"vmess-fallback"`
}

type ListenerConfig added in v0.1.26

type ListenerConfig struct {
	BindAddress    string `yaml:"bind-address"`
	FallbackConfig `yaml:",inline"`
	MMsg           bool `yaml:"mmsg"`
}

type ProxyConfig added in v0.1.26

type ProxyConfig struct {
	Proxy string `yaml:"proxy"`
}

type QuicFallbackConfig added in v0.1.34

type QuicFallbackConfig struct {
	SNI     string `yaml:"sni"`
	Address string `yaml:"address"`
}

type SSFallbackConfig added in v0.1.30

type SSFallbackConfig struct {
	Name     string `yaml:"name"`
	Method   string `yaml:"method"`
	Password string `yaml:"password"`
	Address  string `yaml:"address"`
}

type ServerConfig

type ServerConfig struct {
	ListenerConfig `yaml:",inline"`
	ProxyConfig    `yaml:",inline"`
	Target         []ServerTargetConfig `yaml:"target"`
}

type ServerTargetConfig

type ServerTargetConfig struct {
	*ProxyConfig  `yaml:",inline"`
	TargetAddress string `yaml:"target-address"`
	WSPath        string `yaml:"ws-path"`
}

type TLSFallbackConfig added in v0.1.31

type TLSFallbackConfig struct {
	SNI     string `yaml:"sni"`
	Address string `yaml:"address"`
}

type UdpConfig added in v0.1.33

type UdpConfig struct {
	ListenerConfig `yaml:",inline"`
	TargetAddress  string  `yaml:"target-address"`
	Reserved       []uint8 `yaml:"reserved"`
}

type VmessFallbackConfig added in v0.1.30

type VmessFallbackConfig struct {
	Name    string `yaml:"name"`
	UUID    string `yaml:"uuid"`
	Address string `yaml:"address"`
}

Jump to

Keyboard shortcuts

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