mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-24 03:59:49 +02:00
match Go default TCP keepalive settings
This commit is contained in:
parent
78fe503b57
commit
136984fb14
2 changed files with 26 additions and 7 deletions
|
@ -142,9 +142,13 @@ func (b *Builder) buildInternalCluster(
|
|||
) (*envoy_config_cluster_v3.Cluster, error) {
|
||||
cluster := newDefaultEnvoyClusterConfig()
|
||||
cluster.DnsLookupFamily = config.GetEnvoyDNSLookupFamily(cfg.Options.DNSLookupFamily)
|
||||
// Match the Go standard library default TCP keepalive settings.
|
||||
const keepaliveTimeSeconds = 15
|
||||
cluster.UpstreamConnectionOptions = &envoy_config_cluster_v3.UpstreamConnectionOptions{
|
||||
// Enable TCP keepalive with OS default settings.
|
||||
TcpKeepalive: &envoy_config_core_v3.TcpKeepalive{},
|
||||
TcpKeepalive: &envoy_config_core_v3.TcpKeepalive{
|
||||
KeepaliveTime: wrapperspb.UInt32(keepaliveTimeSeconds),
|
||||
KeepaliveInterval: wrapperspb.UInt32(keepaliveTimeSeconds),
|
||||
},
|
||||
}
|
||||
var endpoints []Endpoint
|
||||
for _, dst := range dsts {
|
||||
|
|
25
config/envoyconfig/testdata/clusters.json
vendored
25
config/envoyconfig/testdata/clusters.json
vendored
|
@ -62,7 +62,10 @@
|
|||
}
|
||||
},
|
||||
"upstreamConnectionOptions": {
|
||||
"tcpKeepalive": {}
|
||||
"tcpKeepalive": {
|
||||
"keepaliveInterval": 15,
|
||||
"keepaliveTime": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -110,7 +113,10 @@
|
|||
}
|
||||
},
|
||||
"upstreamConnectionOptions": {
|
||||
"tcpKeepalive": {}
|
||||
"tcpKeepalive": {
|
||||
"keepaliveInterval": 15,
|
||||
"keepaliveTime": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -158,7 +164,10 @@
|
|||
}
|
||||
},
|
||||
"upstreamConnectionOptions": {
|
||||
"tcpKeepalive": {}
|
||||
"tcpKeepalive": {
|
||||
"keepaliveInterval": 15,
|
||||
"keepaliveTime": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -202,7 +211,10 @@
|
|||
}
|
||||
},
|
||||
"upstreamConnectionOptions": {
|
||||
"tcpKeepalive": {}
|
||||
"tcpKeepalive": {
|
||||
"keepaliveInterval": 15,
|
||||
"keepaliveTime": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -246,7 +258,10 @@
|
|||
}
|
||||
},
|
||||
"upstreamConnectionOptions": {
|
||||
"tcpKeepalive": {}
|
||||
"tcpKeepalive": {
|
||||
"keepaliveInterval": 15,
|
||||
"keepaliveTime": 15
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue