netutil

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KeepAliveIdleTimeout = 120 * time.Second
	KeepAliveInterval    = 30 * time.Second
	KeepAliveConfig      = net.KeepAliveConfig{Enable: true, Idle: KeepAliveIdleTimeout, Interval: KeepAliveInterval}
)

Functions

func DialQUIC added in v0.3.0

func DialQUIC(ctx context.Context, addr string, tlsConf *tls.Config) (*quic.Conn, error)

func DialTCP

func DialTCP(ctx context.Context, addr string) (*net.TCPConn, error)

func DialTLS added in v0.2.1

func DialTLS(ctx context.Context, addr string, tlsConfig *tls.Config) (*tls.Conn, error)

func HTTPClient added in v0.2.1

func HTTPClient(tr *http.Transport) *http.Client

func JoinHostPort added in v0.3.0

func JoinHostPort(host string, port uint16) string

func ListenHTTPAndServe

func ListenHTTPAndServe(ctx context.Context, addr string, httpHandler http.Handler) error

func ListenHTTPAndServeWithListenerCallback added in v0.2.1

func ListenHTTPAndServeWithListenerCallback(ctx context.Context, addr string,
	httpHandler http.Handler, listenerCallback func(ln net.Listener)) error

func ListenQUICAndServe added in v0.3.0

func ListenQUICAndServe(ctx context.Context, addr string, tlsConf *tls.Config,
	statelessResetKey *quic.StatelessResetKey, connHandler func(quicConn *quic.Conn)) error

func ListenTCPAndServe added in v0.2.1

func ListenTCPAndServe(ctx context.Context, addr string, connHandler func(tcpConn *net.TCPConn)) error

func ListenTCPAndServeWithListenerCallback added in v0.2.1

func ListenTCPAndServeWithListenerCallback(ctx context.Context, addr string,
	connHandler func(tcpConn *net.TCPConn), listenSuccessCallback func(ln net.Listener), listenFinishedCallback func()) error

func ListenTLSAndAccept

func ListenTLSAndAccept(ctx context.Context, addr string, tlsConfig *tls.Config,
	connHandler func(conn net.Conn)) error

func StopAllServerListeners added in v0.2.1

func StopAllServerListeners()

func TLSClientConfig added in v0.2.1

func TLSClientConfig(host string, tlsCustomCertFile string, tlsKeyLog bool, http3 bool) (*tls.Config, error)

func TLSServerConfig added in v0.2.1

func TLSServerConfig(host string, tlsCertKeyPair *conf.TLSCertKeyPair, http3 bool) (*tls.Config, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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