Skip to content

Commit

Permalink
Handle termination HTTP signal
Browse files Browse the repository at this point in the history
Provide a method of remotely terminating the proxy.

See Issue abutaha#77
  • Loading branch information
Andrew McIntosh committed Jul 31, 2020
1 parent 675be30 commit 2e2696f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions aws-es-proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ func (p *proxy) getSigner() *v4.Signer {
}

func (p *proxy) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if r.URL.Path == "/terminate-proxy" && r.Method == http.MethodPost {
logrus.Infoln("Terminate Signal")
os.Exit(0)
}

if p.auth {
user, pass, ok := r.BasicAuth()
Expand Down

0 comments on commit 2e2696f

Please sign in to comment.