Documentation ¶
Index ¶
- func ParseUpstream(r *ReverseProxy, upstream *string) (upstream_url url.URL)
- type Listener
- type ReverseProxy
- func (r *ReverseProxy) AddListener(address string)
- func (r *ReverseProxy) AddListenerTLS(address, tlsCert, tlsKey string)
- func (r *ReverseProxy) AddTarget(upstreams []string, router *mux.Router) error
- func (r *ReverseProxy) ClearTargets() error
- func (r *ReverseProxy) Director() func(req *http.Request)
- func (r *ReverseProxy) Start() error
- func (r *ReverseProxy) Stop()
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseUpstream ¶
func ParseUpstream(r *ReverseProxy, upstream *string) (upstream_url url.URL)
Types ¶
type ReverseProxy ¶
type ReverseProxy struct {
// contains filtered or unexported fields
}
func (*ReverseProxy) AddListener ¶
func (r *ReverseProxy) AddListener(address string)
AddListener adds a listener for non-TLS connections on the given address
func (*ReverseProxy) AddListenerTLS ¶
func (r *ReverseProxy) AddListenerTLS(address, tlsCert, tlsKey string)
AddListenerTLS adds a listener for TLS connections on the given address
func (*ReverseProxy) AddTarget ¶
func (r *ReverseProxy) AddTarget(upstreams []string, router *mux.Router) error
AddTarget adds an upstream server to use for a request that matches a given gorilla/mux Router. These are matched via Director function.
func (*ReverseProxy) ClearTargets ¶
func (r *ReverseProxy) ClearTargets() error
func (*ReverseProxy) Director ¶
func (r *ReverseProxy) Director() func(req *http.Request)
Director returns a function for use in http.ReverseProxy.Director. The function matches the incoming request to a specific target and sets the request object to be sent to the matched upstream server.
func (*ReverseProxy) Start ¶
func (r *ReverseProxy) Start() error
Start will listen on configured listeners
func (*ReverseProxy) Stop ¶
func (r *ReverseProxy) Stop()
Stop will gracefully shut down all listening servers
Click to show internal directories.
Click to hide internal directories.