envoy: enable extended connect (#5387)

* envoy: enable extended connect

* add explicit connect

* update config
This commit is contained in:
Caleb Doxsey 2024-12-04 14:54:27 -07:00 committed by GitHub
parent 699679bc57
commit f426403bcb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 2 deletions

View file

@ -212,9 +212,14 @@ func (b *Builder) buildMainHTTPConnectionManagerFilter(
if useQUIC { if useQUIC {
mgr.CodecType = envoy_extensions_filters_network_http_connection_manager.HttpConnectionManager_HTTP3 mgr.CodecType = envoy_extensions_filters_network_http_connection_manager.HttpConnectionManager_HTTP3
mgr.Http3ProtocolOptions = &envoy_config_core_v3.Http3ProtocolOptions{} mgr.Http3ProtocolOptions = http3ProtocolOptions
} else if cfg.Options.GetCodecType() == config.CodecTypeHTTP3 { } else if cfg.Options.GetCodecType() == config.CodecTypeHTTP3 {
mgr.CodecType = envoy_extensions_filters_network_http_connection_manager.HttpConnectionManager_AUTO mgr.CodecType = envoy_extensions_filters_network_http_connection_manager.HttpConnectionManager_AUTO
} else if cfg.Options.GetCodecType() == config.CodecTypeAuto || cfg.Options.GetCodecType() == config.CodecTypeHTTP2 {
mgr.CodecType = cfg.Options.GetCodecType().ToEnvoy()
mgr.Http2ProtocolOptions = &envoy_config_core_v3.Http2ProtocolOptions{
AllowConnect: true,
}
} else { } else {
mgr.CodecType = cfg.Options.GetCodecType().ToEnvoy() mgr.CodecType = cfg.Options.GetCodecType().ToEnvoy()
} }

View file

@ -109,7 +109,9 @@ func TestBuildListeners(t *testing.T) {
hasQUIC = true hasQUIC = true
httpConfig := gjson.Get(protojson.Format(li), "filterChains.0.filters.0.typedConfig") httpConfig := gjson.Get(protojson.Format(li), "filterChains.0.filters.0.typedConfig")
assert.Equal(t, "HTTP3", httpConfig.Get("codecType").String()) assert.Equal(t, "HTTP3", httpConfig.Get("codecType").String())
assert.Equal(t, `{}`, httpConfig.Get("http3ProtocolOptions").String()) assert.JSONEq(t, `{
"allowExtendedConnect": true
}`, httpConfig.Get("http3ProtocolOptions").String())
} }
} }

View file

@ -67,6 +67,10 @@ func WithKeepalive(src *envoy_config_core_v3.Http2ProtocolOptions) *envoy_config
return dst return dst
} }
var http3ProtocolOptions = &envoy_config_core_v3.Http3ProtocolOptions{
AllowExtendedConnect: true,
}
func buildTypedExtensionProtocolOptions( func buildTypedExtensionProtocolOptions(
endpoints []Endpoint, endpoints []Endpoint,
upstreamProtocol upstreamProtocolConfig, upstreamProtocol upstreamProtocolConfig,

View file

@ -103,6 +103,9 @@
} }
} }
}, },
"http2ProtocolOptions": {
"allowConnect": true
},
"localReplyConfig": { "localReplyConfig": {
"mappers": [ "mappers": [
{ {