conf

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolHTTP         = "http"
	ProtocolTLS          = "tls"
	WS_HANDSHAKE_PATH    = "handshake"
	WS_QUERY_REMOTE_ADDR = "remote_addr"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Label         string             `json:"label,omitempty"`
	Listen        string             `json:"listen"`
	ListenType    constant.RelayType `json:"listen_type"`
	TransportType constant.RelayType `json:"transport_type"`
	Remotes       []string           `json:"remotes"`

	Options *Options `json:"options,omitempty"`
}

func (*Config) Adjust

func (r *Config) Adjust() error

func (*Config) Clone

func (r *Config) Clone() *Config

func (*Config) DefaultLabel

func (r *Config) DefaultLabel() string

todo make this shorter and more readable

func (*Config) Different

func (r *Config) Different(new *Config) bool

func (*Config) GetAllRemotes added in v1.1.5

func (r *Config) GetAllRemotes() []*lb.Node

func (*Config) GetLoggerName

func (r *Config) GetLoggerName() string

func (*Config) GetWSHandShakePath

func (r *Config) GetWSHandShakePath() string

func (*Config) GetWSRemoteAddr

func (r *Config) GetWSRemoteAddr(baseAddr string) (string, error)

func (*Config) ToRemotesLB added in v1.1.5

func (r *Config) ToRemotesLB() lb.RoundRobin

func (*Config) Validate

func (r *Config) Validate() error

type Options added in v1.1.5

type Options struct {
	EnableUDP          bool `json:"enable_udp,omitempty"`
	EnableMultipathTCP bool `json:"enable_multipath_tcp,omitempty"`

	// connection limit
	MaxConnection    int      `json:"max_connection,omitempty"`
	BlockedProtocols []string `json:"blocked_protocols,omitempty"`
	MaxReadRateKbps  int64    `json:"max_read_rate_kbps,omitempty"`

	// ws related
	WSConfig *WSConfig `json:"ws_config,omitempty"`

	DialTimeoutSec  int `json:"dial_timeout_sec,omitempty"`
	IdleTimeoutSec  int `json:"idle_timeout_sec,omitempty"`
	ReadTimeoutSec  int `json:"read_timeout_sec,omitempty"`
	SniffTimeoutSec int `json:"sniff_timeout_sec,omitempty"`

	// timeout in duration
	DialTimeout  time.Duration `json:"-"`
	IdleTimeout  time.Duration `json:"-"`
	ReadTimeout  time.Duration `json:"-"`
	SniffTimeout time.Duration `json:"-"`
}

func (*Options) Clone added in v1.1.5

func (o *Options) Clone() *Options

type WSConfig

type WSConfig struct {
	Path       string `json:"path,omitempty"`
	RemoteAddr string `json:"remote_addr,omitempty"`
}

func (*WSConfig) Clone added in v1.1.5

func (w *WSConfig) Clone() *WSConfig

Jump to

Keyboard shortcuts

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