proxy

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const StatusClientClosedRequest = 499

StatusClientClosedRequest non-standard HTTP status code for client disconnection

View Source
const StatusClientClosedRequestText = "Client Closed Connection"

StatusClientClosedRequestText non-standard HTTP status for client disconnection

Variables

This section is empty.

Functions

func HandleRoundTripError

func HandleRoundTripError(rw http.ResponseWriter, req *http.Request, err error)

func New

func New(
	cfg *Config,
	trnsprt http.RoundTripper,
	preparer request.Preparer,
	modifier response.Modifier,
	errorHandler HandleRoundTripErrorFunc,
	pool httputil.BufferPool,
) (*httputil.ReverseProxy, error)

New creates a new HTTP proxy

func StatusCodeFromRoundTripError

func StatusCodeFromRoundTripError(err error) int

func StatusText

func StatusText(statusCode int) string

Types

type Config

type Config struct {
	Transport     *transport.Config     `json:"transport,omitempty"`
	FlushInterval *json.Duration        `json:"flushInterval,omitempty"`
	Request       *request.ProxyConfig  `json:"request,omitempty"`
	Response      *response.ProxyConfig `json:"response,omitempty"`
}

func (*Config) SetDefault

func (cfg *Config) SetDefault() *Config

type HandleRoundTripErrorFunc

type HandleRoundTripErrorFunc func(rw http.ResponseWriter, req *http.Request, err error)

Jump to

Keyboard shortcuts

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