director

package
v1.0.0-alpha.test.10b Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AdhocTransport = &http.Transport{
		Proxy: http.ProxyFromEnvironment,
		DialContext: (&net.Dialer{
			Timeout:   30 * time.Second,
			KeepAlive: 30 * time.Second,
			DualStack: true,
		}).DialContext,
		MaxIdleConns:          100,
		IdleConnTimeout:       90 * time.Second,
		TLSHandshakeTimeout:   10 * time.Second,
		ExpectContinueTimeout: 1 * time.Second,
	}
)

Functions

func AuthMiddleware

func AuthMiddleware(authorizer authorize.Authorizer) httpwares.Middleware

Types

type Proxy

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

Proxy is a forward/reverse proxy that implements Route+Backend and Adhoc Rules forwarding.

func New

func New(pool backendpool.Pool, router router.Router, addresser adhoc.Addresser, logEntry logrus.FieldLogger) *Proxy

New creates a forward/reverse proxy that is either Route+Backend and Adhoc Rules forwarding.

The Router decides which "well-known" routes a given request matches, and which backend from the Pool it should be sent to. The backends in the Pool have pre-dialed connections and are load balanced.

If Adhoc routing supports dialing to whitelisted DNS names either through DNS A or SRV records for undefined backends.

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(resp http.ResponseWriter, req *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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