forked from simonmittag/j8a
-
Notifications
You must be signed in to change notification settings - Fork 0
/
connection.go
58 lines (44 loc) · 1.87 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
package jabba
// Connection Params
type Connection struct {
Downstream Downstream
Upstream Upstream
}
// Downstream params for the HTTP or TLS server that Jabba 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
// Serving Mode, can be "TLS"
Mode string
// Serving on this port
Port int
// TLS x509 certificate
Cert string
// TLS secret key
Key string
}
// 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 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
}