-
Notifications
You must be signed in to change notification settings - Fork 6
/
app.go
21 lines (18 loc) · 1.22 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package config
import "time"
// HSTSTimeout sets the HSTS timeout length in seconds. See HSTSHandler in app_base.go for info
// Set this to -1 to turn off HSTS
var HSTSTimeout int64 = 86400 // one day
// ReadTimeout specifies the time that a client has to complete sending us its request.
// It helps prevent an attack where the client opens a connection and then sends us data really slowly.
// See go's http package, server.go for details.
var ReadTimeout = 5 * time.Second
// ReadTimeout specifies the time that a client has to complete sending us its headers. See go's http package, server.go for details.
// This can be used to control per request read timeouts. If zero, ReadTimeout is used.
var ReadHeaderTimeout = 0 * time.Second
// WriteTimeout is the amount of time our server will wait for our app to finish writing the response. It helps prevent
// an attack where the server makes a request, but then reads the response very slowly.
var WriteTimeout = 10 * time.Second
// IdleTimout is used during keep-alive connections to control how often the client must ping us to keep the connection alive.
// It helps us detect whether the client has gone away so that we can then close the connection.
var IdleTimeout = 180 * time.Second