http: alpn upstream (#13922)

Signed-off-by: Alyssa Wilk <alyssar@chromium.org>

Mirrored from https://github.com/envoyproxy/envoy @ 93ee668a690d297ab5e8bd2cbf03771d852ebbda
pull/623/head
data-plane-api(Azure Pipelines) 4 years ago
parent 9442dd4970
commit b0a0cc18dc
  1. 19
      envoy/extensions/upstreams/http/v3/http_protocol_options.proto
  2. 22
      envoy/extensions/upstreams/http/v4alpha/http_protocol_options.proto

@ -56,6 +56,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE;
// http2_protocol_options: // http2_protocol_options:
// max_concurrent_streams: 100 // max_concurrent_streams: 100
// .... [further cluster config] // .... [further cluster config]
// [#next-free-field: 6]
message HttpProtocolOptions { message HttpProtocolOptions {
// If this is used, the cluster will only operate on one of the possible upstream protocols (HTTP/1.1, HTTP/2). // If this is used, the cluster will only operate on one of the possible upstream protocols (HTTP/1.1, HTTP/2).
// Note that HTTP/2 should generally be used for upstream clusters doing gRPC. // Note that HTTP/2 should generally be used for upstream clusters doing gRPC.
@ -77,6 +78,21 @@ message HttpProtocolOptions {
config.core.v3.Http2ProtocolOptions http2_protocol_options = 2; config.core.v3.Http2ProtocolOptions http2_protocol_options = 2;
} }
// If this is used, the cluster can use either HTTP/1 or HTTP/2, and will use whichever
// protocol is negotiated by ALPN with the upstream.
// Clusters configured with *AutoHttpConfig* will use the highest available
// protocol; HTTP/2 if supported, otherwise HTTP/1.
// If the upstream does not support ALPN, *AutoHttpConfig* will fail over to HTTP/1.
// This can only be used with transport sockets which support ALPN. Using a
// transport socket which does not support ALPN will result in configuration
// failure. The transport layer may be configured with custom ALPN, but the default ALPN
// for the cluster (or if custom ALPN fails) will be "h2,http/1.1".
message AutoHttpConfig {
config.core.v3.Http1ProtocolOptions http_protocol_options = 1;
config.core.v3.Http2ProtocolOptions http2_protocol_options = 2;
}
// This contains options common across HTTP/1 and HTTP/2 // This contains options common across HTTP/1 and HTTP/2
config.core.v3.HttpProtocolOptions common_http_protocol_options = 1; config.core.v3.HttpProtocolOptions common_http_protocol_options = 1;
@ -94,5 +110,8 @@ message HttpProtocolOptions {
// This allows switching on protocol based on what protocol the downstream // This allows switching on protocol based on what protocol the downstream
// connection used. // connection used.
UseDownstreamHttpConfig use_downstream_protocol_config = 4; UseDownstreamHttpConfig use_downstream_protocol_config = 4;
// This allows switching on protocol based on ALPN
AutoHttpConfig auto_config = 5;
} }
} }

@ -57,6 +57,7 @@ option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSIO
// http2_protocol_options: // http2_protocol_options:
// max_concurrent_streams: 100 // max_concurrent_streams: 100
// .... [further cluster config] // .... [further cluster config]
// [#next-free-field: 6]
message HttpProtocolOptions { message HttpProtocolOptions {
option (udpa.annotations.versioning).previous_message_type = option (udpa.annotations.versioning).previous_message_type =
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions"; "envoy.extensions.upstreams.http.v3.HttpProtocolOptions";
@ -87,6 +88,24 @@ message HttpProtocolOptions {
config.core.v4alpha.Http2ProtocolOptions http2_protocol_options = 2; config.core.v4alpha.Http2ProtocolOptions http2_protocol_options = 2;
} }
// If this is used, the cluster can use either HTTP/1 or HTTP/2, and will use whichever
// protocol is negotiated by ALPN with the upstream.
// Clusters configured with *AutoHttpConfig* will use the highest available
// protocol; HTTP/2 if supported, otherwise HTTP/1.
// If the upstream does not support ALPN, *AutoHttpConfig* will fail over to HTTP/1.
// This can only be used with transport sockets which support ALPN. Using a
// transport socket which does not support ALPN will result in configuration
// failure. The transport layer may be configured with custom ALPN, but the default ALPN
// for the cluster (or if custom ALPN fails) will be "h2,http/1.1".
message AutoHttpConfig {
option (udpa.annotations.versioning).previous_message_type =
"envoy.extensions.upstreams.http.v3.HttpProtocolOptions.AutoHttpConfig";
config.core.v4alpha.Http1ProtocolOptions http_protocol_options = 1;
config.core.v4alpha.Http2ProtocolOptions http2_protocol_options = 2;
}
// This contains options common across HTTP/1 and HTTP/2 // This contains options common across HTTP/1 and HTTP/2
config.core.v4alpha.HttpProtocolOptions common_http_protocol_options = 1; config.core.v4alpha.HttpProtocolOptions common_http_protocol_options = 1;
@ -104,5 +123,8 @@ message HttpProtocolOptions {
// This allows switching on protocol based on what protocol the downstream // This allows switching on protocol based on what protocol the downstream
// connection used. // connection used.
UseDownstreamHttpConfig use_downstream_protocol_config = 4; UseDownstreamHttpConfig use_downstream_protocol_config = 4;
// This allows switching on protocol based on ALPN
AutoHttpConfig auto_config = 5;
} }
} }

Loading…
Cancel
Save