proxyserver

package
v0.0.0-...-745c448 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyServer

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

ProxyServer defines the HTTP proxy server.

func NewProxyServer

func NewProxyServer(
	d bool,
	turl string,
	rd uint,
	bmo bool,
	rw string,
	re bool,
	ri bool,
	l *zap.Logger,
	pr RequestCopy,
) *ProxyServer

NewProxyServer constructor creates a new ProxyServer.

func (*ProxyServer) ServeHTTP

func (s *ProxyServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP is the main handler used by the server.

func (*ProxyServer) WithRequestLoggerMiddleware

func (s *ProxyServer) WithRequestLoggerMiddleware() http.Handler

WithRequestLoggerMiddleware is "middleware" that logs every request

type RequestCopy

type RequestCopy struct {
	Method    string
	TargetURL string
	TargetURI string
	Header    headerCopy
	Body      []byte
}

RequestCopy defines a request representation that is used to compare requests. The values are captured from incoming HTTP requests.

Jump to

Keyboard shortcuts

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