portforward

package
v0.0.0-...-ba854f2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0 Imports: 12 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServePortForward

func ServePortForward(ctx context.Context, w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, idleTimeout time.Duration, streamCreationTimeout time.Duration, supportedProtocols []string)

ServePortForward handles a port forwarding request. A single request is kept alive as long as the client is still alive and the connection has not been timed out due to idleness. This function handles multiple forwarded connections; i.e., multiple `curl http://localhost:8888/` requests will be handled by a single invocation of ServePortForward.

Types

type PortForwarder

type PortForwarder interface {
	// PortForwarder copies data between a data stream and a port in a pod.
	PortForward(ctx context.Context, name string, port int32, stream io.ReadWriteCloser) error
}

PortForwarder knows how to forward content from a data stream to/from a port in a pod.

Jump to

Keyboard shortcuts

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