v0.0.0-...-c13e492 Latest Latest

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0, BSD-2-Clause-Views, BSD-3-Clause, + 1 more Imports: 19 Imported by: 0




This section is empty.


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


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)


type Forwarder

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

func (*Forwarder) ForwardIO

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

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,
	errorWriter errorwriter.ErrorWriter,
	endpointDialTimeout time.Duration,
	websocketDialTimeout time.Duration,
	maxAttempts int,
	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