proxy

package
v0.3.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 12 Imported by: 2

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

func NewReverseProxy(backend, clientCert, clientKeyFile, caFile string) (*KCPProxy, error)

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL