proxy

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndpointIDFromRequest added in v0.3.0

func EndpointIDFromRequest(r *http.Request) string

EndpointIDFromRequest returns the endpoint ID from the HTTP request, or an empty string if no endpoint ID is specified.

This will check both the 'x-piko-endpoint' header and 'Host' header, where x-piko-endpoint takes precedence.

Types

type ReverseProxy added in v0.3.0

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

func NewReverseProxy added in v0.3.0

func NewReverseProxy(
	upstreams upstream.Manager,
	timeout time.Duration,
	logger log.Logger,
) *ReverseProxy

func (*ReverseProxy) ServeHTTP added in v0.3.0

func (p *ReverseProxy) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Server added in v0.3.0

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

func NewServer added in v0.3.0

func NewServer(
	upstreams upstream.Manager,
	proxyConfig config.ProxyConfig,
	registry *prometheus.Registry,
	tlsConfig *tls.Config,
	logger log.Logger,
) *Server

func (*Server) Serve added in v0.3.0

func (s *Server) Serve(ln net.Listener) error

func (*Server) Shutdown added in v0.3.0

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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