|
@@ -60,7 +60,7 @@ func createRestServer(port int) *http.Server {
|
|
|
r.HandleFunc("/rules/{name}/stop", stopRuleHandler).Methods(http.MethodPost)
|
|
|
r.HandleFunc("/rules/{name}/restart", restartRuleHandler).Methods(http.MethodPost)
|
|
|
|
|
|
- return &http.Server{
|
|
|
+ server := &http.Server{
|
|
|
Addr: fmt.Sprintf("0.0.0.0:%d", port),
|
|
|
// Good practice to set timeouts to avoid Slowloris attacks.
|
|
|
WriteTimeout: time.Second * 15,
|
|
@@ -68,6 +68,8 @@ func createRestServer(port int) *http.Server {
|
|
|
IdleTimeout: time.Second * 60,
|
|
|
Handler: r, // Pass our instance of gorilla/mux in.
|
|
|
}
|
|
|
+ server.SetKeepAlivesEnabled(false)
|
|
|
+ return server
|
|
|
}
|
|
|
|
|
|
//list or create streams
|