Documentation ¶
Index ¶
- func GetServerTLSConfig(tlsCertFile, tlsKeyFile, tlsMinVersion string, tlsCipherSuites []string) (*tls.Config, error)
- func GetTCPNetwork() string
- func GetUDPNetwork() string
- func IsTrivialNetworkError(err error) bool
- func ParseTLSVersion(s string) (uint16, error)
- func TCP6Enabled() bool
- type TCPListener
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetServerTLSConfig ¶ added in v1.77.0
func GetServerTLSConfig(tlsCertFile, tlsKeyFile, tlsMinVersion string, tlsCipherSuites []string) (*tls.Config, error)
GetServerTLSConfig returns TLS config for the server.
func GetTCPNetwork ¶ added in v1.56.0
func GetTCPNetwork() string
GetTCPNetwork returns current tcp network.
func GetUDPNetwork ¶ added in v1.56.0
func GetUDPNetwork() string
GetUDPNetwork returns current udp network.
func IsTrivialNetworkError ¶ added in v1.87.0
IsTrivialNetworkError returns true if the err can be ignored during logging.
func ParseTLSVersion ¶ added in v1.82.0
ParseTLSVersion returns tls version from the given string s.
func TCP6Enabled ¶ added in v1.34.0
func TCP6Enabled() bool
TCP6Enabled returns true if dialing and listening for IPv4 TCP is enabled.
Types ¶
type TCPListener ¶
TCPListener listens for the addr passed to NewTCPListener.
It also gathers various stats for the accepted connections.
func NewTCPListener ¶
func NewTCPListener(name, addr string, useProxyProtocol bool, tlsConfig *tls.Config) (*TCPListener, error)
NewTCPListener returns new TCP listener for the given addr and optional tlsConfig.
name is used for metrics. Each listener in the program must have a distinct name.
If useProxyProtocol is set to true, then the returned listener accepts TCP connections via proxy protocol. See https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt