handler

package
v0.0.0-...-2fc2a81 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2018 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MaxRetries = 3
)

Variables

View Source
var NoEndpointsAvailable = errors.New("No endpoints available")

Functions

func DisableSourceIPLogging

func DisableSourceIPLogging(t bool) func(*RequestHandler)

func DisableXFFLogging

func DisableXFFLogging(t bool) func(*RequestHandler)

func SetRequestXCfInstanceId

func SetRequestXCfInstanceId(request *http.Request, endpoint *route.Endpoint)

func SetRequestXRequestStart

func SetRequestXRequestStart(request *http.Request)

Types

type Forwarder

type Forwarder struct {
	BackendReadTimeout time.Duration
	Logger             logger.Logger
}

func (*Forwarder) ForwardIO

func (f *Forwarder) ForwardIO(clientConn, backendConn io.ReadWriter) int

ForwardIO sets up websocket forwarding with a backend

It returns after one of the connections closes.

If the backend response code is not 101 Switching Protocols, then ForwardIO will return immediately, allowing the caller to close the connections.

type RequestHandler

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

func NewRequestHandler

func NewRequestHandler(request *http.Request, response utils.ProxyResponseWriter, r metrics.ProxyReporter, logger logger.Logger, endpointDialTimeout time.Duration, tlsConfig *tls.Config, opts ...func(*RequestHandler)) *RequestHandler

func (*RequestHandler) HandleBadGateway

func (h *RequestHandler) HandleBadGateway(err error, request *http.Request)

func (*RequestHandler) HandleTcpRequest

func (h *RequestHandler) HandleTcpRequest(iter route.EndpointIterator)

func (*RequestHandler) HandleWebSocketRequest

func (h *RequestHandler) HandleWebSocketRequest(iter route.EndpointIterator)

func (*RequestHandler) Logger

func (h *RequestHandler) Logger() logger.Logger

Jump to

Keyboard shortcuts

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