httpp

package
v1.20.1-soundar.7 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 23 Imported by: 0

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

func ParseContentType(v string) string

ParseContentType parses a Content-Type header and returns the content type.

func RemoteAddr

func RemoteAddr(ctx *gin.Context) string

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

func (*Server) Close

func (s *Server) Close()

Close closes all resources and waits for all routines to return.

func (*Server) Initialize

func (s *Server) Initialize() error

Initialize initializes a Server.

Jump to

Keyboard shortcuts

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