kubernetes/staging/src/k8s.io/apiserver/pkg/util/proxy/streamtunnel.go

type TunnelingHandler

// NewTunnelingHandler is used to create the tunnel between an upstream
// SPDY connection and a downstream tunneling connection through the stored
// UpgradeAwareProxy.
func NewTunnelingHandler(upgradeHandler http.Handler) *TunnelingHandler {}

// ServeHTTP uses the upgradeHandler to tunnel between a downstream tunneling
// connection and an upstream SPDY connection. The tunneling connection is
// a wrapped WebSockets connection which communicates SPDY framed data. In the
// case the upstream upgrade fails, we delegate communication to the passed
// in "w" ResponseWriter.
func (h *TunnelingHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {}

// createSPDYRequest modifies the passed request to remove
// WebSockets headers and add SPDY upgrade information, including
// spdy protocols acceptable to the client.
func createSPDYRequest(req *http.Request, spdyProtocols ...string) *http.Request {}

// spdyProtocolsFromWebsocketProtocols returns a list of spdy protocols by filtering
// to Kubernetes websocket subprotocols prefixed with "SPDY/3.1+", then removing the prefix
func spdyProtocolsFromWebsocketProtocols(req *http.Request) []string {}

var _

var _

type tunnelingResponseWriter

// Hijack returns a delegate "net.Conn".
// An error is returned if Write(), WriteHeader(), or Hijack() was previously called.
// The returned bufio.ReadWriter is always nil.
func (w *tunnelingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {}

// Header is delegated to the stored "http.ResponseWriter".
func (w *tunnelingResponseWriter) Header() http.Header {}

// Write is delegated to the stored "http.ResponseWriter".
func (w *tunnelingResponseWriter) Write(p []byte) (int, error) {}

// WriteHeader is delegated to the stored "http.ResponseWriter".
func (w *tunnelingResponseWriter) WriteHeader(statusCode int) {}

type headerInterceptingConn

type initializableConn

const maxHeaderBytes

var lfCRLF

var lfLF

// Write intercepts to initially swallow the HTTP response, then
// delegate to the tunneling "net.Conn" once the response has been
// seen and processed.
func (h *headerInterceptingConn) Write(b []byte) (int, error) {}

type tunnelingWebsocketUpgraderConn

func (u *tunnelingWebsocketUpgraderConn) InitializeWrite(backendResponse *http.Response, backendResponseBytes []byte) (err error) {}

func (u *tunnelingWebsocketUpgraderConn) Read(b []byte) (n int, err error) {}

func (u *tunnelingWebsocketUpgraderConn) Write(b []byte) (n int, err error) {}

func (u *tunnelingWebsocketUpgraderConn) Close() error {}

func (u *tunnelingWebsocketUpgraderConn) LocalAddr() net.Addr {}

func (u *tunnelingWebsocketUpgraderConn) RemoteAddr() net.Addr {}

func (u *tunnelingWebsocketUpgraderConn) SetDeadline(t time.Time) error {}

func (u *tunnelingWebsocketUpgraderConn) SetReadDeadline(t time.Time) error {}

func (u *tunnelingWebsocketUpgraderConn) SetWriteDeadline(t time.Time) error {}

type noopAddr

func (n noopAddr) Network() string {}

func (n noopAddr) String() string  {}