Skip to content

Commit

Permalink
Configure read/write timeout and disable KeepAlive
Browse files Browse the repository at this point in the history
This was probably the cause for #47
  • Loading branch information
fleaz committed May 8, 2019
1 parent 0746558 commit 14f128c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,17 @@ func main() {
go ircConnection(viper.Sub("irc"), channelList)

// Start HTTP server
srv := &http.Server{
Addr: viper.GetString("http.listen"),
ReadTimeout: 5 * time.Second,
WriteTimeout: 5 * time.Second,
}
srv.SetKeepAlivesEnabled(false)

log.WithFields(log.Fields{
"listen": viper.GetString("http.listen"),
}).Info("Started HTTP Server")
log.Fatal(http.ListenAndServe(viper.GetString("http.listen"), nil))

log.Fatal(srv.ListenAndServe(), nil)

}

0 comments on commit 14f128c

Please sign in to comment.