kubernetes/staging/src/k8s.io/apimachinery/pkg/util/proxy/upgradeaware.go

type UpgradeRequestRoundTripper

type UpgradeAwareHandler

const defaultFlushInterval

type ErrorResponder

type SimpleErrorResponder

func NewErrorResponder(r SimpleErrorResponder) ErrorResponder {}

type simpleResponder

func (r simpleResponder) Error(w http.ResponseWriter, req *http.Request, err error) {}

type upgradeRequestRoundTripper

var _

var _

// WrappedRoundTripper returns the round tripper that a caller would use.
func (rt *upgradeRequestRoundTripper) WrappedRoundTripper() http.RoundTripper {}

// WriteToRequest calls the nested upgrader and then copies the returned request
// fields onto the passed request.
func (rt *upgradeRequestRoundTripper) WrapRequest(req *http.Request) (*http.Request, error) {}

type onewayRoundTripper

// RoundTrip returns a simple 200 OK response that captures the provided request.
func (onewayRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {}

var MirrorRequest

// NewUpgradeRequestRoundTripper takes two round trippers - one for the underlying TCP connection, and
// one that is able to write headers to an HTTP request. The request rt is used to set the request headers
// and that is written to the underlying connection rt.
func NewUpgradeRequestRoundTripper(connection, request http.RoundTripper) UpgradeRequestRoundTripper {}

// normalizeLocation returns the result of parsing the full URL, with scheme set to http if missing
func normalizeLocation(location *url.URL) *url.URL {}

// NewUpgradeAwareHandler creates a new proxy handler with a default flush interval. Responder is required for returning
// errors to the caller.
func NewUpgradeAwareHandler(location *url.URL, transport http.RoundTripper, wrapTransport, upgradeRequired bool, responder ErrorResponder) *UpgradeAwareHandler {}

func proxyRedirectsforRootPath(path string, w http.ResponseWriter, req *http.Request) bool {}

// ServeHTTP handles the proxy request
func (h *UpgradeAwareHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {}

type noSuppressPanicError

func (noSuppressPanicError) Write(p []byte) (n int, err error) {}

// tryUpgrade returns true if the request was handled.
func (h *UpgradeAwareHandler) tryUpgrade(w http.ResponseWriter, req *http.Request) bool {}

// FIXME: Taken from net/http/httputil/reverseproxy.go as singleJoiningSlash is not exported to be re-used.
// See-also: https://github.com/golang/go/issues/44290
func singleJoiningSlash(a, b string) string {}

func (h *UpgradeAwareHandler) DialForUpgrade(req *http.Request) (net.Conn, error) {}

// getResponseCode reads a http response from the given reader, returns the response,
// the bytes read from the reader, and any error encountered
func getResponse(r io.Reader) (*http.Response, []byte, error) {}

// dial dials the backend at req.URL and writes req to it.
func dial(req *http.Request, transport http.RoundTripper) (net.Conn, error) {}

func (h *UpgradeAwareHandler) defaultProxyTransport(url *url.URL, internalTransport http.RoundTripper) http.RoundTripper {}

type corsRemovingTransport

var _

func (rt *corsRemovingTransport) RoundTrip(req *http.Request) (*http.Response, error) {}

func (rt *corsRemovingTransport) WrappedRoundTripper() http.RoundTripper {}

// removeCORSHeaders strip CORS headers sent from the backend
// This should be called on all responses before returning
func removeCORSHeaders(resp *http.Response) {}