Documentation
¶
Overview ¶
Package httpp contains HTTP utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Credentials ¶
func Credentials(h *http.Request) *auth.Credentials
Credentials extracts credentials from a HTTP request.
func ParseContentType ¶
ParseContentType parses a Content-Type header and returns the content type.
func RemoteAddr ¶
RemoteAddr returns the remote address of an HTTP client, with the IP replaced by the real IP passed by any proxy in between.
Types ¶
type Server ¶
type Server struct {
Address string
AllowOrigins []string
DumpPackets bool
DumpPacketsPrefix string
ReadTimeout time.Duration
WriteTimeout time.Duration
Encryption bool
ServerCert string
ServerKey string
AllowAutoCert bool
GetCertificate func(*tls.ClientHelloInfo) (*tls.Certificate, error)
Handler http.Handler
Parent logger.Writer
// contains filtered or unexported fields
}
Server is a wrapper around http.Server that provides: - net.Listener creation and destruction - TLS initialization and hot reload - exit on panic - logging - server header - filtering of invalid requests
Click to show internal directories.
Click to hide internal directories.