proxy

package
v0.28.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionID = "{{CONNECTION_ID}}"
	HTTPProto    = "{{HTTP_PROTO}}"
	SourceIP     = "{{SOURCE_IP}}"
	SourcePort   = "{{SOURCE_PORT}}"
	SourceIPPort = "{{SOURCE_IP}}:{{SOURCE_PORT}}"
)
View Source
const (
	ProtocolHTTP  = "http"
	ProtocolHTTPS = "https"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.20.2

type Config struct {
	DefaultTarget           string
	TargetMap               []string
	Headers                 []string
	KeepAliveTimeoutSeconds int
	HTTPSBackend            bool
	HTTPSBackendIgnoreCert  bool
	EnableAccessLog         bool
}

func (*Config) Apply added in v0.20.2

func (c *Config) Apply(ctx context.Context, p *HTTPProxy) error

type Director added in v0.20.2

type Director interface {
	Director(request *http.Request) error
}

type DirectorChain added in v0.20.2

type DirectorChain []Director

func NewDirectorChain added in v0.20.2

func NewDirectorChain(directors ...Director) DirectorChain

skip nil directors

func (DirectorChain) Director added in v0.20.2

func (c DirectorChain) Director(request *http.Request) error

type DirectorDestMap added in v0.20.2

type DirectorDestMap map[string]string

func NewDirectorDestMap added in v0.20.2

func NewDirectorDestMap(m map[string]string) DirectorDestMap

func (DirectorDestMap) Director added in v0.20.2

func (d DirectorDestMap) Director(request *http.Request) error

type DirectorHost added in v0.20.2

type DirectorHost string

func NewDirectorHost added in v0.20.2

func NewDirectorHost(host string) DirectorHost

func (DirectorHost) Director added in v0.20.2

func (d DirectorHost) Director(request *http.Request) error

type DirectorSameIP added in v0.20.2

type DirectorSameIP struct {
	Port string
}

func NewDirectorSameIP added in v0.20.2

func NewDirectorSameIP(port int) DirectorSameIP

func (DirectorSameIP) Director added in v0.20.2

func (s DirectorSameIP) Director(request *http.Request) error

type DirectorSetHeaders added in v0.20.2

type DirectorSetHeaders map[string]string

func NewDirectorSetHeaders added in v0.20.2

func NewDirectorSetHeaders(m map[string]string) DirectorSetHeaders

func (DirectorSetHeaders) Director added in v0.20.2

func (h DirectorSetHeaders) Director(request *http.Request) error

type DirectorSetScheme added in v0.22.6

type DirectorSetScheme string

func NewSetSchemeDirector added in v0.22.6

func NewSetSchemeDirector(scheme string) DirectorSetScheme

func (DirectorSetScheme) Director added in v0.22.6

func (d DirectorSetScheme) Director(req *http.Request) error

type HTTPProxy

type HTTPProxy struct {
	GetContext           func(req *http.Request) (context.Context, error)
	HandleHTTPValidation func(w http.ResponseWriter, r *http.Request) bool
	Director             Director // modify requests to backend.
	HTTPTransport        http.RoundTripper
	EnableAccessLog      bool

	IdleTimeout time.Duration
	// contains filtered or unexported fields
}

func NewHTTPProxy

func NewHTTPProxy(ctx context.Context, listener net.Listener) *HTTPProxy

func (*HTTPProxy) Close added in v0.23.9

func (p *HTTPProxy) Close() error

func (*HTTPProxy) Start added in v0.20.2

func (p *HTTPProxy) Start() error

Start - finish initialization of proxy and start handling request. It is sync method, always return with non nil error: if handle stopped by context or if error on start handling. Any public fields must not change after Start called

type Transport added in v0.22.6

type Transport struct {
	IgnoreHTTPSCertificate bool
}

func (Transport) RoundTrip added in v0.22.6

func (t Transport) RoundTrip(req *http.Request) (*http.Response, error)

type TransportLogger added in v0.23.16

type TransportLogger struct {
	Transport http.RoundTripper
}

func NewTransportLogger added in v0.23.16

func NewTransportLogger(transport http.RoundTripper) TransportLogger

func (TransportLogger) RoundTrip added in v0.23.16

func (t TransportLogger) RoundTrip(request *http.Request) (resp *http.Response, err error)

Jump to

Keyboard shortcuts

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