proxy

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultInterceptors = make(Interceptors)
)

Functions

func ClientHintsInterceptor

func ClientHintsInterceptor(ctx *context.Context) (proceed bool, err error)

func PrefixInterceptor

func PrefixInterceptor(ctx *context.Context) (proceed bool, err error)

func RemoveServerHeader

func RemoveServerHeader(ctx *context.Context) (proceed bool, err error)

func UpstreamHintsInterceptor

func UpstreamHintsInterceptor(ctx *context.Context) (proceed bool, err error)

func WhitelistedRemotesInterceptor

func WhitelistedRemotesInterceptor(ctx *context.Context) (proceed bool, err error)

Types

type AccessLogger

type AccessLogger func(*lctx.Context)

type CompressInterceptor added in v0.7.0

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

func NewCompressInterceptor added in v0.7.0

func NewCompressInterceptor() *CompressInterceptor

func (*CompressInterceptor) Handle added in v0.7.0

func (this *CompressInterceptor) Handle(ctx *context.Context) (proceed bool, err error)

func (*CompressInterceptor) HandlesStages added in v0.7.0

func (this *CompressInterceptor) HandlesStages() []context.Stage

func (*CompressInterceptor) Name added in v0.7.0

func (this *CompressInterceptor) Name() string

type CorsInterceptor

type CorsInterceptor struct{}

func NewCorsInterceptor

func NewCorsInterceptor() *CorsInterceptor

func (*CorsInterceptor) Handle

func (this *CorsInterceptor) Handle(ctx *context.Context) (proceed bool, err error)

func (*CorsInterceptor) HandlesStages

func (this *CorsInterceptor) HandlesStages() []context.Stage

func (*CorsInterceptor) Name

func (this *CorsInterceptor) Name() string

type CustomHeaders

type CustomHeaders struct{}

func (*CustomHeaders) Handle

func (this *CustomHeaders) Handle(ctx *context.Context) (proceed bool, err error)

func (*CustomHeaders) HandlesStages

func (this *CustomHeaders) HandlesStages() []context.Stage

func (*CustomHeaders) Name

func (this *CustomHeaders) Name() string

type ForceSecureInterceptor

type ForceSecureInterceptor struct{}

func (*ForceSecureInterceptor) Handle

func (this *ForceSecureInterceptor) Handle(ctx *context.Context) (proceed bool, err error)

func (*ForceSecureInterceptor) HandlesStages

func (this *ForceSecureInterceptor) HandlesStages() []context.Stage

func (*ForceSecureInterceptor) Name

func (this *ForceSecureInterceptor) Name() string

type Interceptor

type Interceptor interface {
	Name() string
	Handle(ctx *context.Context) (proceed bool, err error)
	HandlesStages() []context.Stage
}

type InterceptorFunc

type InterceptorFunc func(ctx *context.Context) (proceed bool, err error)

type Interceptors

type Interceptors map[context.Stage]map[string]Interceptor

func (Interceptors) Add

func (Interceptors) AddFunc

func (this Interceptors) AddFunc(name string, i InterceptorFunc, stages ...context.Stage) Interceptors

func (Interceptors) Clone

func (this Interceptors) Clone() Interceptors

func (Interceptors) Handle

func (this Interceptors) Handle(ctx *context.Context) (proceed bool, err error)

func (Interceptors) Remove

func (this Interceptors) Remove(i Interceptor) Interceptors

func (Interceptors) RemoveByName

func (this Interceptors) RemoveByName(name string) Interceptors

type Proxy

type Proxy struct {
	Dialer          net.Dialer
	Transport       http.Transport
	RulesRepository rules.Repository
	Logger          log.Logger

	ResultHandler    lctx.ResultHandler
	AccessLogger     AccessLogger
	Interceptors     Interceptors
	MetricsCollector lctx.MetricsCollector
	// contains filtered or unexported fields
}

func New

func New(s *settings.Settings, rules rules.Repository, logger log.Logger) (*Proxy, error)

func (*Proxy) Init added in v0.1.7

func (this *Proxy) Init(support.Channel) error

func (*Proxy) ServeHTTP

func (this *Proxy) ServeHTTP(connector server.Connector, resp http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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