Add automatic configuration reloading and

policy handling
This commit is contained in:
Travis Groth 2019-05-30 08:48:56 -04:00
parent 77f3933560
commit 8c2beac6f1
12 changed files with 287 additions and 34 deletions

View file

@ -423,14 +423,6 @@ func (p *Proxy) authenticate(w http.ResponseWriter, r *http.Request, session *se
return nil
}
// Handle constructs a route from the given host string and matches it to the provided http.Handler and UpstreamConfig
func (p *Proxy) Handle(host string, handler http.Handler, pol *policy.Policy) {
p.routeConfigs[host] = &routeConfig{
mux: handler,
policy: *pol,
}
}
// router attempts to find a route for a request. If a route is successfully matched,
// it returns the route information and a bool value of `true`. If a route can not be matched,
// a nil value for the route and false bool value is returned.