proxy

package
v1.6.6 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectCluster

func ConnectCluster(ctx context.Context, cluster *clusterapis.Cluster, proxyPath string, secretGetter func(context.Context, string, string) (*corev1.Secret, error), responder registryrest.Responder) (http.Handler, error)

ConnectCluster returns a handler for proxy cluster.

func Location

func Location(cluster *clusterapis.Cluster) (*url.URL, http.RoundTripper, error)

Location returns a URL to which one can send traffic for the specified cluster.

func NewThrottledUpgradeAwareProxyHandler

func NewThrottledUpgradeAwareProxyHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder registryrest.Responder) *proxy.UpgradeAwareHandler

NewThrottledUpgradeAwareProxyHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.

func ParseProxyHeaders added in v1.6.3

func ParseProxyHeaders(proxyHeaders map[string]string) http.Header

Types

type UpgradeAwareHandler added in v1.6.3

type UpgradeAwareHandler struct {
	proxyutil.UpgradeAwareHandler

	UpgradeDialer *UpgradeDialer
}

func NewUpgradeAwareHandler added in v1.6.3

func NewUpgradeAwareHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder proxyutil.ErrorResponder) *UpgradeAwareHandler

NewUpgradeAwareHandler creates a new proxy handler with a default flush interval. Responder is required for returning errors to the caller.

func (*UpgradeAwareHandler) ServeHTTP added in v1.6.3

func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)

ServeHTTP handles the proxy request

type UpgradeDialer added in v1.6.3

type UpgradeDialer struct {

	// Dialer is the dialer used to connect.  Used if non-nil.
	Dialer *net.Dialer
	// contains filtered or unexported fields
}

UpgradeDialer knows how to upgrade an HTTP request to one that supports multiplexed streams. After Dial() is invoked, Conn will be usable.

func NewUpgradeDialerWithConfig added in v1.6.3

func NewUpgradeDialerWithConfig(cfg UpgradeDialerWithConfig) *UpgradeDialer

NewUpgradeDialerWithConfig creates a new UpgradeRoundTripper with the specified configuration.

func (*UpgradeDialer) Dial added in v1.6.3

func (u *UpgradeDialer) Dial(req *http.Request) (net.Conn, error)

Dial implements k8s.io/apimachinery/pkg/util/net.Dialer.

func (*UpgradeDialer) TLSClientConfig added in v1.6.3

func (u *UpgradeDialer) TLSClientConfig() *tls.Config

TLSClientConfig implements pkg/util/net.TLSClientConfigHolder for proper TLS checking during proxying with a roundtripper.

type UpgradeDialerWithConfig added in v1.6.3

type UpgradeDialerWithConfig struct {
	// TLS configuration used by the round tripper.
	TLS *tls.Config
	// Header holds the HTTP request headers for dialing. Optional.
	Header http.Header
	// Proxier is a proxy function invoked on each request. Optional.
	Proxier func(*http.Request) (*url.URL, error)
	// PingPeriod is a period for sending Pings on the connection.
	// Optional.
	PingPeriod time.Duration
}

UpgradeDialerWithConfig is a set of options for an UpgradeDialer.

Jump to

Keyboard shortcuts

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