proxy

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SSLNone defines to run http server only
	SSLNone sslMode = iota

	// SSLStatic defines to run both https and http server. Redirect http to https
	SSLStatic

	// SSLAuto defines to run both https and http server. Redirect http to https. Https server with autocert support
	SSLAuto
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Http

type Http struct {
	Matcher
	Address        string
	AssetsLocation string
	AssetsWebRoot  string
	MaxBodySize    int64
	GzEnabled      bool
	ProxyHeaders   []string
	SSLConfig      SSLConfig
	Version        string
	AccessLog      io.Writer
	StdOutEnabled  bool
	Signature      bool
	Timeouts       Timeouts
}

Http is a proxy server for both http and https

func (*Http) Run

func (h *Http) Run(ctx context.Context) error

Run the lister and request's router, activate rest server

type Matcher

type Matcher interface {
	Match(srv, src string) (string, discovery.MatchType, bool)
	Servers() (servers []string)
	Mappers() (mappers []discovery.URLMapper)
}

Matcher source info (server and route) to the destination url If no match found return ok=false

type SSLConfig

type SSLConfig struct {
	SSLMode       sslMode
	Cert          string
	Key           string
	ACMELocation  string
	ACMEEmail     string
	FQDNs         []string
	RedirHTTPPort int
}

SSLConfig holds all ssl params for rest server

type Timeouts added in v0.2.0

type Timeouts struct {
	// server timeouts
	ReadHeader time.Duration
	Write      time.Duration
	Idle       time.Duration
	// transport timeouts
	Dial           time.Duration
	KeepAlive      time.Duration
	IdleConn       time.Duration
	TLSHandshake   time.Duration
	ExpectContinue time.Duration
	ResponseHeader time.Duration
}

Timeouts consolidate timeouts for both server and transport

Jump to

Keyboard shortcuts

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