-
Notifications
You must be signed in to change notification settings - Fork 11
/
connection.go
95 lines (71 loc) · 2.75 KB
/
connection.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package j8a
// Connection Params
type Connection struct {
Downstream Downstream
Upstream Upstream
}
// Downstream params for the HTTP or TLS server that j8a exposes
type Downstream struct {
// ReadTimeoutSeconds is the maximum duration for reading the entire
// request, including the body, the downstream user agent sends to us.
ReadTimeoutSeconds int
// WriteTimeoutSeconds is the maximum duration round trip time in seconds any
// single request spends in the server, this includes the time to read the request,
// processing upstream attempts and writing the response into downstream socket.
RoundTripTimeoutSeconds int
// IdleTimeoutSeconds is the maximum duration, a downstream idle socket connection is kept open
// before the server hangs up on the downstream user agent.
IdleTimeoutSeconds int
// MaxBodyBytes is the maximum size of the incoming HTTP request body before it is rejected
MaxBodyBytes int64
// Http block. defaults to on
Http Http
// Tls block defaults to off
Tls Tls
}
type Http struct {
// Serving HTTP on this port
Port int
// Redirect HTTP to tls if set to "TLS". Only one value allowed.
Redirecttls bool
}
type Tls struct {
// Serving on this port
Port int
// TLS x509 certificate
Cert string
// TLS secret key
Key string
// Acme config for TLS. Optional, but conflicts with Cert and Key
Acme Acme
}
type Acme struct {
// Acme Provider, currently supports letsencrypt
Provider string
// Domain
Domains []string
// Email for registration.
Email string
// Number of days before certificate expiry that triggers first renewal attempt
GracePeriodDays int
}
// Upstream connection params for remote servers that are being proxied
type Upstream struct {
// PoolSize is the maximum size of the client socket connection pool for idle connections
PoolSize int
// IdleTimeoutSeconds is the total wait period in seconds before we hang up on an idle upstream connection.
IdleTimeoutSeconds int
// SocketTimeoutSeconds is the wait period to establish socket connection with an upstream server.
// This setting controls roundtrip time for establishing simple TCP connections, combined with handshake time for TLS
// if applicable.
SocketTimeoutSeconds int
// ReadTimeoutSeconds is the wait period to read the entire upstream response once connection was established
// before an individual upstream request is aborted
ReadTimeoutSeconds int
// MaxAttempts is the maximum allowable number of request attempts to obtain a successful response for repeatable
// HTTP requests.
MaxAttempts int
// TlsInsecureSkipVerify skips the host name validation and certificate chain verification of upstream connections
// using TLS. Use this only for testing or if you know what you are doing. Defaults to false
TlsInsecureSkipVerify bool
}