proxy

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

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

Go to latest
Published: Jun 2, 2020 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package proxy provides a http proxy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMiddleware

func NewMiddleware(l *zap.Logger) func(next http.Handler) http.Handler

NewMiddleware instantiates a middleware function that logs all requests using the provided logger

Types

type BackendHost

type BackendHost struct {
	// address of the backend host
	Addr string
	// if true we use http connection
	Insecure bool
}

BackendHost is a host we want to proxy to

type Options

type Options struct {
	ListenAddress    string
	LogFile          string
	Backends         map[string]*BackendHost
	BasicAuthEnabled bool
	BasicAuthRealm   string
	BasicAuthUsers   map[string]string
}

Options used in configuring the proxy

func DefaultOptions

func DefaultOptions() *Options

DefaultOptions returns a generic, default options mainly useful for testing

type Proxy

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

Proxy enables a http proxy

func New

func New(opts *Options) *Proxy

New returns an initialized, but unstarted proxy

func (*Proxy) Run

func (p *Proxy) Run(ctx context.Context, tlsOpts *TLSOpts) error

Run starts the http proxy

type TLSOpts

type TLSOpts struct {
	CertFile string
	KeyFile  string
	// contains filtered or unexported fields
}

TLSOpts allows configuring the tls endpoint for the proxy

Jump to

Keyboard shortcuts

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