Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHandler ¶
func NewHandler(o *proxyoptions.Options) (http.Handler, error)
func ProxyHandler ¶
func ProxyHandler(p *KCPProxy, UserHeader, GroupHeader string) func(wr http.ResponseWriter, req *http.Request)
ProxyHandler extracts the CN as a user name and Organizations as groups from the client cert and adds them as HTTP headers to backend request.
Types ¶
type KCPProxy ¶
type KCPProxy struct {
// contains filtered or unexported fields
}
KCPProxy wraps the httputil.ReverseProxy and captures the backend name.
func NewReverseProxy ¶
NewReverseProxy returns a new reverse proxy where backend is the backend URL to connect to, clientCert is the proxy's client cert to use to connect to it, clientKeyFile is the proxy's client private key file, and caFile is the CA the proxy uses to verify the backend server's cert.
type PathMapping ¶
type PathMapping struct { Path string `json:"path"` Backend string `json:"backend"` BackendServerCA string `json:"backend_server_ca"` ProxyClientCert string `json:"proxy_client_cert"` ProxyClientKey string `json:"proxy_client_key"` UserHeader string `json:"user_header,omitempty"` GroupHeader string `json:"group_header,omitempty"` }
PathMapping describes how to route traffic from a path to a backend server. Each Path is registered with the DefaultServeMux with a handler that delegates to the specified backend.