Documentation
¶
Index ¶
- Constants
- type Config
- func (r *Config) Adjust() error
- func (r *Config) Clone() *Config
- func (r *Config) DefaultLabel() string
- func (r *Config) Different(new *Config) bool
- func (r *Config) GetAllRemotes() []*lb.Node
- func (r *Config) GetLoggerName() string
- func (r *Config) GetWSHandShakePath() string
- func (r *Config) GetWSRemoteAddr(baseAddr string) (string, error)
- func (r *Config) ToRemotesLB() lb.RoundRobin
- func (r *Config) Validate() error
- type Options
- type WSConfig
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) DefaultLabel ¶
todo make this shorter and more readable
func (*Config) GetAllRemotes ¶ added in v1.1.5
func (*Config) GetLoggerName ¶
func (*Config) GetWSHandShakePath ¶
func (*Config) ToRemotesLB ¶ added in v1.1.5
func (r *Config) ToRemotesLB() lb.RoundRobin
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:"-"`
}
Click to show internal directories.
Click to hide internal directories.