Documentation ¶
Overview ¶
package ws has functionality to parse 'kubectl exec' sessions streamed using WebSocket protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(c net.Conn, rec *tsrecorder.Client, ch sessionrecording.CastHeader, hasTerm bool, log *zap.SugaredLogger) net.Conn
New wraps the provided network connection and returns a connection whose reads and writes will get triggered as data is received on the hijacked connection. The connection must be a hijacked connection for a 'kubectl exec' session using WebSocket protocol and a *.channel.k8s.io subprotocol. The hijacked connection is used to transmit *.channel.k8s.io streams between Kubernetes client ('kubectl') and the destination proxy controlled by Kubernetes. Data read from the underlying network connection is data sent via one of the streams from the client to the container. Data written to the underlying connection is data sent from the container to the client. We parse the data and send everything for the stdout/stderr streams to the configured tsrecorder as an asciinema recording with the provided header. https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/4006-transition-spdy-to-websockets#proposal-new-remotecommand-sub-protocol-version---v5channelk8sio
Types ¶
This section is empty.