proxy

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close added in v1.4.1

func Close()

func ListenAndServeHTTP added in v1.4.1

func ListenAndServeHTTP(l config.Listen, h http.Handler, cfg *tls.Config) error

func ListenAndServeTCP added in v1.4.1

func ListenAndServeTCP(l config.Listen, h tcp.Handler, cfg *tls.Config) error

func ListenTCP added in v1.4.1

func ListenTCP(laddr string, cfg *tls.Config) (net.Listener, error)

func Shutdown

func Shutdown(timeout time.Duration)

Types

type HTTPProxy added in v1.4.1

type HTTPProxy struct {
	// Config is the proxy configuration as provided during startup.
	Config config.Proxy

	// Time returns the current time as the number of seconds since the epoch.
	// If Time is nil, time.Now is used.
	Time func() time.Time

	// Transport is the http connection pool configured with timeouts.
	// The proxy will panic if this value is nil.
	Transport http.RoundTripper

	// InsecureTransport is the http connection pool configured with
	// InsecureSkipVerify set. This is used for https proxies with
	// self-signed certs.
	InsecureTransport http.RoundTripper

	// Lookup returns a target host for the given request.
	// The proxy will panic if this value is nil.
	Lookup func(*http.Request) *route.Target

	// Requests is a timer metric which is updated for every request.
	Requests metrics.Timer

	// Noroute is a counter metric which is updated for every request
	// where Lookup() returns nil.
	Noroute metrics.Counter

	// Logger is the access logger for the requests.
	Logger logger.Logger

	// UUID returns a unique id in uuid format.
	// If UUID is nil, uuid.NewUUID() is used.
	UUID func() string
}

HTTPProxy is a dynamic reverse proxy for HTTP and HTTPS protocols.

func (*HTTPProxy) ServeHTTP added in v1.4.1

func (p *HTTPProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server added in v1.4.1

type Server interface {
	Close() error
	Serve(l net.Listener) error
	Shutdown(ctx context.Context) error
}

Directories

Path Synopsis
Package gzip provides an HTTP handler which compresses responses if the client supports this, the response is compressable and not already compressed.
Package gzip provides an HTTP handler which compresses responses if the client supports this, the response is compressable and not already compressed.
tcp

Jump to

Keyboard shortcuts

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