Documentation ¶
Index ¶
Constants ¶
View Source
const ( ProbeStatusCode = http.StatusOK ProbeResponse = "OK" )
Variables ¶
This section is empty.
Functions ¶
func IsKubernetesProbeRequest ¶ added in v0.3.0
Types ¶
type HTTPHandler ¶
type HTTPHandler struct { // required, the URL that requests will be forwarding to To *url.URL // required, internal reverse proxy that forwards the requests ReverseProxy *httputil.ReverseProxy // optional, preserve the host in outbound requests PreserveHost bool // optional, but in fact required, injecting fingerprint headers to outbound requests HeaderInjectors []HeaderInjector // optional, if IsProbeRequest returns true, handler will respond with // a HTTP 200 OK instead of forwarding requests, useful for kubernetes // liveness/readiness probes. defaults to nil, which disables this behavior IsProbeRequest func(*http.Request) bool }
func NewHTTPHandler ¶
func NewHTTPHandler(to *url.URL, reverseProxy *httputil.ReverseProxy, headerInjectors []HeaderInjector) *HTTPHandler
func (*HTTPHandler) ServeHTTP ¶
func (f *HTTPHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*HTTPHandler) SetReverseProxyRewriteFunc ¶
func (f *HTTPHandler) SetReverseProxyRewriteFunc()
Click to show internal directories.
Click to hide internal directories.