proxy

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HTTPReverseProxy

func HTTPReverseProxy(options Options) (net.Listener, error)

HTTPReverseProxy provides a default setup for proxying internal components within the framework

Types

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware is a way to use composition to add functionality by intercepting the req/response cycle of the Reverse Proxy. Each handler must accept an http.Handler and also return an http.Handler, allowing a simple way to chain functionality together

type Options

type Options struct {

	// TargetScheme is one of 'http' or 'https'
	TargetScheme string

	// TargetAddress is the host:port component to proxy
	TargetAddress string

	// TargetPath is the path on the target to proxy
	TargetPath string

	// ProxyPort is the port to make available for proxying
	// Defaults to a random port
	ProxyPort int

	// Middleware to apply to the Proxy
	Middleware []Middleware

	// Internal request prefix for proxy to not rewrite
	InternalRequestPathPrefix string

	// Custom TLS Configuration for communicating with a Provider
	// Useful when verifying self-signed services, MASSL etc.
	CustomTLSConfig *tls.Config
}

Options for the Reverse Proxy configuration

Jump to

Keyboard shortcuts

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