proxy

package
v0.0.0-...-0f3e1e6 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2017 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

func ListenAndServeHTTP

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

func ListenAndServeTCP

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

func ListenTCP

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

func Shutdown

func Shutdown(timeout time.Duration)

Types

type HTTPProxy

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

	// IAM performs identity and access management for a given request.  It is disabled if set
	// to nil
	IAM iam.IAM
}

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

func (*HTTPProxy) ServeHTTP

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

type Server

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