http

package
v0.0.0-...-82567e2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseWriterProxy

type ResponseWriterProxy struct {
	// contains filtered or unexported fields
}

ResponseWriterProxy records the written response

func NewWriterProxy

func NewWriterProxy(w http.ResponseWriter) *ResponseWriterProxy

NewWriterProxy returns a proxy

func (*ResponseWriterProxy) Flush

func (p *ResponseWriterProxy) Flush()

Flush inmplements http.Flusher

func (*ResponseWriterProxy) Header

func (p *ResponseWriterProxy) Header() http.Header

Header implements http.ResponseWriter

func (*ResponseWriterProxy) Hijack

func (p *ResponseWriterProxy) Hijack() (net.Conn, *bufio.ReadWriter, error)

Hijack is a wrapper of http.Hijacker underearth if any, otherwise it just returns an error. from https://github.com/mholt/caddy/pull/134

func (*ResponseWriterProxy) Response

func (p *ResponseWriterProxy) Response() *http.Response

Response returns the writer as a http.Response

func (*ResponseWriterProxy) Write

func (p *ResponseWriterProxy) Write(buf []byte) (int, error)

Write implements http.ResponseWriter

func (*ResponseWriterProxy) WriteHeader

func (p *ResponseWriterProxy) WriteHeader(code int)

WriteHeader implements http.ResponseWriter

type Server

type Server struct {
	DocumentRoot  string
	Callback      ServerCallback
	Port          int
	PreferredPort int
	PKCS12        string
	AllowHTTP     bool
	Logger        zerolog.Logger
	Appversion    string
	UseGzip       bool
	TlsKeyLogFile string
	// contains filtered or unexported fields
}

Server represents a server

func (*Server) Handler

func (s *Server) Handler(w http.ResponseWriter, r *http.Request)

Handler handles HTTP requests

func (*Server) ProxyHandler

func (s *Server) ProxyHandler(w http.ResponseWriter, r *http.Request)

ProxyHandler wraps the regular handler to log the HTTP messages

func (*Server) Start

func (s *Server) Start(errChan chan error) (int, error)

Start starts the server

type ServerCallback

type ServerCallback func(w http.ResponseWriter, r *http.Request, env map[string]string) error

ServerCallback serves non-static HTTP resources

Jump to

Keyboard shortcuts

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