client-gok8s.io/client-go/pkg/kubelet/server/portforward Index | Files

package portforward

import "k8s.io/client-go/pkg/kubelet/server/portforward"

package portforward contains server-side logic for handling port forwarding requests.

Index

Constants

const PortForwardProtocolV1Name = "portforward.k8s.io"

The subprotocol "portforward.k8s.io" is used for port forwarding.

Functions

func ServePortForward

func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, uid types.UID, idleTimeout time.Duration, streamCreationTimeout time.Duration)

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(name string, uid types.UID, port uint16, stream io.ReadWriteCloser) error
}

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

Source Files

constants.go portforward.go

Version
v2.0.0+incompatible
Published
Feb 13, 2017
Platform
js/wasm
Imports
13 packages
Last checked
2 minutes ago

Tools for package owners.