Versions in this module Expand all Collapse all v1 v1.0.0 Apr 9, 2022 Changes in this version + const KB + const MB + func GetMapByPrefix(set map[string]string, prefix string) map[string]string + func GetMapWithoutPrefix(set map[string]string, prefix string) map[string]string + func GetRenderedConfFromFile(path string) (out []byte, err error) + func LoadAllProxyConfsFromIni(prefix string, source interface{}, start []string) (map[string]ProxyConf, map[string]VisitorConf, error) + func RenderContent(in []byte) (out []byte, err error) + type BandwidthQuantity struct + func MustBandwidthQuantity(s string) BandwidthQuantity + func NewBandwidthQuantity(s string) (BandwidthQuantity, error) + func (q *BandwidthQuantity) Bytes() int64 + func (q *BandwidthQuantity) Equal(u *BandwidthQuantity) bool + func (q *BandwidthQuantity) MarshalJSON() ([]byte, error) + func (q *BandwidthQuantity) String() string + func (q *BandwidthQuantity) UnmarshalJSON(b []byte) error + func (q *BandwidthQuantity) UnmarshalString(s string) error + type BaseProxyConf struct + BandwidthLimit BandwidthQuantity + Group string + GroupKey string + Metas map[string]string + ProxyName string + ProxyProtocolVersion string + ProxyType string + UseCompression bool + UseEncryption bool + func (cfg *BaseProxyConf) GetBaseInfo() *BaseProxyConf + type BaseVisitorConf struct + BindAddr string + BindPort int + ProxyName string + ProxyType string + Role string + ServerName string + Sk string + UseCompression bool + UseEncryption bool + func (cfg *BaseVisitorConf) GetBaseInfo() *BaseVisitorConf + type ClientCommonConf struct + AdminAddr string + AdminPort int + AdminPwd string + AdminUser string + AssetsDir string + ConnectServerLocalIP string + DNSServer string + DialServerKeepAlive int64 + DialServerTimeout int64 + DisableCustomTLSFirstByte bool + DisableLogColor bool + HTTPProxy string + HeartbeatInterval int64 + HeartbeatTimeout int64 + IncludeConfigFiles []string + LogFile string + LogLevel string + LogMaxDays int64 + LogWay string + LoginFailExit bool + Metas map[string]string + PoolCount int + PprofEnable bool + Protocol string + ServerAddr string + ServerPort int + Start []string + TCPMux bool + TCPMuxKeepaliveInterval int64 + TLSCertFile string + TLSEnable bool + TLSKeyFile string + TLSServerName string + TLSTrustedCaFile string + UDPPacketSize int64 + User string + func GetDefaultClientConf() ClientCommonConf + func ParseClientConfig(filePath string) (cfg ClientCommonConf, pxyCfgs map[string]ProxyConf, ...) + func UnmarshalClientConfFromIni(source interface{}) (ClientCommonConf, error) + func (cfg *ClientCommonConf) Complete() + func (cfg *ClientCommonConf) Validate() error + type DomainConf struct + CustomDomains []string + SubDomain string + type HTTPProxyConf struct + HTTPPwd string + HTTPUser string + Headers map[string]string + HostHeaderRewrite string + Locations []string + func (cfg *HTTPProxyConf) CheckForCli() (err error) + func (cfg *HTTPProxyConf) CheckForSvr(serverCfg ServerCommonConf) (err error) + func (cfg *HTTPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *HTTPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *HTTPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *HTTPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type HTTPSProxyConf struct + func (cfg *HTTPSProxyConf) CheckForCli() (err error) + func (cfg *HTTPSProxyConf) CheckForSvr(serverCfg ServerCommonConf) (err error) + func (cfg *HTTPSProxyConf) Compare(cmp ProxyConf) bool + func (cfg *HTTPSProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *HTTPSProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *HTTPSProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type HealthCheckConf struct + HealthCheckAddr string + HealthCheckIntervalS int + HealthCheckMaxFailed int + HealthCheckTimeoutS int + HealthCheckType string + HealthCheckURL string + type LocalSvrConf struct + LocalIP string + LocalPort int + Plugin string + PluginParams map[string]string + type ProxyConf interface + CheckForCli func() error + CheckForSvr func(ServerCommonConf) error + Compare func(ProxyConf) bool + GetBaseInfo func() *BaseProxyConf + MarshalToMsg func(*msg.NewProxy) + UnmarshalFromIni func(string, string, *ini.Section) error + UnmarshalFromMsg func(*msg.NewProxy) + func DefaultProxyConf(proxyType string) ProxyConf + func NewConfByType(proxyType string) ProxyConf + func NewProxyConfFromIni(prefix, name string, section *ini.Section) (ProxyConf, error) + func NewProxyConfFromMsg(pMsg *msg.NewProxy, serverCfg ServerCommonConf) (ProxyConf, error) + type STCPProxyConf struct + Role string + Sk string + func (cfg *STCPProxyConf) CheckForCli() (err error) + func (cfg *STCPProxyConf) CheckForSvr(serverCfg ServerCommonConf) error + func (cfg *STCPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *STCPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *STCPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *STCPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type STCPVisitorConf struct + func (cfg *STCPVisitorConf) Check() (err error) + func (cfg *STCPVisitorConf) Compare(cmp VisitorConf) bool + func (cfg *STCPVisitorConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) (err error) + type SUDPProxyConf struct + Role string + Sk string + func (cfg *SUDPProxyConf) CheckForCli() (err error) + func (cfg *SUDPProxyConf) CheckForSvr(serverCfg ServerCommonConf) error + func (cfg *SUDPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *SUDPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *SUDPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *SUDPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type SUDPVisitorConf struct + func (cfg *SUDPVisitorConf) Check() (err error) + func (cfg *SUDPVisitorConf) Compare(cmp VisitorConf) bool + func (cfg *SUDPVisitorConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) (err error) + type ServerCommonConf struct + AllowPorts map[int]struct{} + AssetsDir string + BindAddr string + BindPort int + BindUDPPort int + Custom404Page string + DashboardAddr string + DashboardPort int + DashboardPwd string + DashboardUser string + DetailedErrorsToClient bool + DisableLogColor bool + EnablePrometheus bool + HTTPPlugins map[string]plugin.HTTPPluginOptions + HeartbeatTimeout int64 + KCPBindPort int + LogFile string + LogLevel string + LogMaxDays int64 + LogWay string + MaxPoolCount int64 + MaxPortsPerClient int64 + PprofEnable bool + ProxyBindAddr string + SubDomainHost string + TCPKeepAlive int64 + TCPMux bool + TCPMuxHTTPConnectPort int + TCPMuxKeepaliveInterval int64 + TLSCertFile string + TLSKeyFile string + TLSOnly bool + TLSTrustedCaFile string + UDPPacketSize int64 + UserConnTimeout int64 + VhostHTTPPort int + VhostHTTPSPort int + VhostHTTPTimeout int64 + func GetDefaultServerConf() ServerCommonConf + func UnmarshalServerConfFromIni(source interface{}) (ServerCommonConf, error) + func (cfg *ServerCommonConf) Complete() + func (cfg *ServerCommonConf) Validate() error + type TCPMuxProxyConf struct + Multiplexer string + func (cfg *TCPMuxProxyConf) CheckForCli() (err error) + func (cfg *TCPMuxProxyConf) CheckForSvr(serverCfg ServerCommonConf) (err error) + func (cfg *TCPMuxProxyConf) Compare(cmp ProxyConf) bool + func (cfg *TCPMuxProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *TCPMuxProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *TCPMuxProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type TCPProxyConf struct + RemotePort int + func (cfg *TCPProxyConf) CheckForCli() (err error) + func (cfg *TCPProxyConf) CheckForSvr(serverCfg ServerCommonConf) error + func (cfg *TCPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *TCPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *TCPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *TCPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type UDPProxyConf struct + RemotePort int + func (cfg *UDPProxyConf) CheckForCli() (err error) + func (cfg *UDPProxyConf) CheckForSvr(serverCfg ServerCommonConf) error + func (cfg *UDPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *UDPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *UDPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *UDPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type Values struct + Envs map[string]string + func GetValues() *Values + type VisitorConf interface + Check func() error + Compare func(cmp VisitorConf) bool + GetBaseInfo func() *BaseVisitorConf + UnmarshalFromIni func(prefix string, name string, section *ini.Section) error + func DefaultVisitorConf(visitorType string) VisitorConf + func NewVisitorConfFromIni(prefix string, name string, section *ini.Section) (VisitorConf, error) + type XTCPProxyConf struct + Role string + Sk string + func (cfg *XTCPProxyConf) CheckForCli() (err error) + func (cfg *XTCPProxyConf) CheckForSvr(serverCfg ServerCommonConf) error + func (cfg *XTCPProxyConf) Compare(cmp ProxyConf) bool + func (cfg *XTCPProxyConf) MarshalToMsg(pMsg *msg.NewProxy) + func (cfg *XTCPProxyConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) error + func (cfg *XTCPProxyConf) UnmarshalFromMsg(pMsg *msg.NewProxy) + type XTCPVisitorConf struct + func (cfg *XTCPVisitorConf) Check() (err error) + func (cfg *XTCPVisitorConf) Compare(cmp VisitorConf) bool + func (cfg *XTCPVisitorConf) UnmarshalFromIni(prefix string, name string, section *ini.Section) (err error)