package portforward
import "k8s.io/kubernetes/pkg/kubelet/server/portforward"
package portforward contains server-side logic for handling port forwarding requests.
Index ¶
- Constants
- Variables
- func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, uid types.UID, portForwardOptions *V4Options, idleTimeout time.Duration, streamCreationTimeout time.Duration, supportedProtocols []string)
- type PortForwarder
- type V4Options
Constants ¶
const ProtocolV1Name = "portforward.k8s.io"
The subprotocol "portforward.k8s.io" is used for port forwarding.
Variables ¶
var SupportedProtocols = []string{ProtocolV1Name}
Functions ¶
func ServePortForward ¶
func ServePortForward(w http.ResponseWriter, req *http.Request, portForwarder PortForwarder, podName string, uid types.UID, portForwardOptions *V4Options, 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(name string, uid types.UID, port int32, stream io.ReadWriteCloser) error }
PortForwarder knows how to forward content from a data stream to/from a port in a pod.
type V4Options ¶
type V4Options struct { Ports []int32 }
options contains details about which streams are required for port forwarding. All fields incldued in V4Options need to be expressed explicilty in the CRI (pkg/kubelet/apis/cri/{version}/api.proto) PortForwardRequest.
func BuildV4Options ¶
BuildV4Options returns a V4Options based on the given information.
func NewV4Options ¶
newOptions creates a new options from the Request.
Source Files ¶
constants.go httpstream.go portforward.go websocket.go
- Version
- v1.7.8
- Published
- Oct 5, 2017
- Platform
- js/wasm
- Imports
- 17 packages
- Last checked
- 43 seconds ago –
Tools for package owners.