netutils

package
v0.0.0-...-10d9ced Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureSafeTLSConfig

func ConfigureSafeTLSConfig() *tls.Config

ConfigureSafeTLSConfig creates a default tls.Config that's considered "safe" for HTTP serving

func CreateDefaultResilientHTTPServer

func CreateDefaultResilientHTTPServer(addr string, mux http.Handler) *http.Server

CreateDefaultResilientHTTPServer returns an http.Server configured with default configuration

func CreateResilientHTTPServer

func CreateResilientHTTPServer(addr string, mux http.Handler, tlsConfig *tls.Config,
	headerReadTimeout, writeTimeout, idleTimeout *time.Duration) *http.Server

CreateResilientHTTPServer returns an http.Server configured with the timeouts provided

func GetConnIP

func GetConnIP(c net.Conn) (string, string)

Return connection IP and port

func StartHTTPServer

func StartHTTPServer(ip string, handler http.Handler)

Start HTTP server

func StartMTLSServer

func StartMTLSServer(ip, certca, certificate, key string, handler http.Handler)

Types

This section is empty.

Jump to

Keyboard shortcuts

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