Timeout reads and writes in the http server.

This commit is contained in:
Tom Wilkie
2016-10-10 14:22:18 -07:00
parent 2bc31e8728
commit 0bde1b62e1

View File

@@ -276,8 +276,11 @@ func appMain(flags appFlags) {
// we want to manage the stop condition ourselves below
NoSignalHandling: true,
Server: &http.Server{
Addr: flags.listen,
Handler: handler,
Addr: flags.listen,
Handler: handler,
ReadTimeout: 10 * time.Second,
WriteTimeout: 10 * time.Second,
MaxHeaderBytes: 1 << 20,
},
}
go func() {