From e0e1281ec3b0cbb075303d3838edb65f12a36f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Fri, 14 Jul 2023 12:47:22 +0200 Subject: [PATCH] http: Use own server --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index bcd73b8..f3ff93c 100644 --- a/main.go +++ b/main.go @@ -453,6 +453,10 @@ func main() { logger.Infof("Listening on %s, ntfy-alertmanager %s", cfg.HTTPAddress, version) mux := http.NewServeMux() + httpServer := &http.Server{ + Addr: cfg.HTTPAddress, + Handler: mux, + } if cfg.User != "" && cfg.Password != "" { logger.Info("Enabling HTTP Basic Authentication") @@ -466,5 +470,5 @@ func main() { if _, ok := c.(*cache.MemoryCache); ok { go bridge.runCleanup() } - logger.Fatal(http.ListenAndServe(cfg.HTTPAddress, mux)) + logger.Fatal(httpServer.ListenAndServe()) }