Repository: envoyproxy/envoy
File: api/envoy/extensions/filters/network/tcp_proxy/v3/tcp_proxy.proto (Protocol Buffers)

Code before:

      // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints
      // in the upstream cluster with metadata matching what is set in this field will be considered
      // for load balancing. Note that this will be merged with what's provided in
      // :ref:`TcpProxy.metadata_match
      // <envoy_v3_api_field_extensions.filters.network.tcp_proxy.v3.TcpProxy.metadata_match>`, with values
      // here taking precedence. The filter name should be specified as ``envoy.lb``.
      config.core.v3.Metadata metadata_match = 3;
    }

    // Specifies the upstream clusters associated with this configuration.
    repeated ClusterWeight clusters = 1 [(validate.rules).repeated = {min_items: 1}];
  }

  // Configuration for tunneling TCP over other transports or application layers.
  // Tunneling is supported over HTTP/1.1 and HTTP/2. The upstream protocol is
  // determined by the cluster configuration.
  // [#next-free-field: 8]
  message TunnelingConfig {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.config.filter.network.tcp_proxy.v2.TcpProxy.TunnelingConfig";

    // The hostname to send in the synthesized CONNECT headers to the upstream proxy.
    // This field evaluates command operators if present; otherwise, the value is used as-is.
    //
    // For example:
    //
    // .. code-block:: yaml
    //
    //    tunneling_config:
    //      hostname: "%REQUESTED_SERVER_NAME%:443"
    //
    // For example, dynamically set the hostname using dynamic metadata:
    //
    // .. code-block:: yaml
    //
    //    tunneling_config:
    //      hostname: "%DYNAMIC_METADATA(tunnel:address)%"
    //
    string hostname = 1 [(validate.rules).string = {min_len: 1}];

    // Use the ``POST`` method instead of the ``CONNECT`` method to tunnel the TCP stream.
    // The ``protocol: bytestream`` header is not set for HTTP/2 to comply with the specification.
    //
    // The upstream proxy is expected to interpret the POST payload as raw TCP.
    bool use_post = 2;

    // Additional request headers to send to the upstream proxy. This is mainly used to
    // trigger the upstream to convert POST requests back to CONNECT requests.
    //
    // Neither ``:``-prefixed pseudo-headers like ``:path`` nor the ``host`` header can be overridden.

Review comment (suggestion):
```suggestion
    // For example, dynamically set the hostname using downstream SNI:
```

Code after:

      // Optional endpoint metadata match criteria used by the subset load balancer. Only endpoints
      // in the upstream cluster with metadata matching what is set in this field will be considered
      // for load balancing. Note that this will be merged with what's provided in
      // :ref:`TcpProxy.metadata_match
      // <envoy_v3_api_field_extensions.filters.network.tcp_proxy.v3.TcpProxy.metadata_match>`, with values
      // here taking precedence. The filter name should be specified as ``envoy.lb``.
      config.core.v3.Metadata metadata_match = 3;
    }

    // Specifies the upstream clusters associated with this configuration.
    repeated ClusterWeight clusters = 1 [(validate.rules).repeated = {min_items: 1}];
  }

  // Configuration for tunneling TCP over other transports or application layers.
  // Tunneling is supported over HTTP/1.1 and HTTP/2. The upstream protocol is
  // determined by the cluster configuration.
  // [#next-free-field: 8]
  message TunnelingConfig {
    option (udpa.annotations.versioning).previous_message_type =
        "envoy.config.filter.network.tcp_proxy.v2.TcpProxy.TunnelingConfig";

    // The hostname to send in the synthesized CONNECT headers to the upstream proxy.
    // This field evaluates command operators if present; otherwise, the value is used as-is.
    //
    // For example, dynamically set the hostname using downstream SNI:
    //
    // .. code-block:: yaml
    //
    //    tunneling_config:
    //      hostname: "%REQUESTED_SERVER_NAME%:443"
    //
    // For example, dynamically set the hostname using dynamic metadata:
    //
    // .. code-block:: yaml
    //
    //    tunneling_config:
    //      hostname: "%DYNAMIC_METADATA(tunnel:address)%"
    //
    string hostname = 1 [(validate.rules).string = {min_len: 1}];

    // Use the ``POST`` method instead of the ``CONNECT`` method to tunnel the TCP stream.
    // The ``protocol: bytestream`` header is not set for HTTP/2 to comply with the specification.
    //
    // The upstream proxy is expected to interpret the POST payload as raw TCP.
    bool use_post = 2;

    // Additional request headers to send to the upstream proxy. This is mainly used to
    // trigger the upstream to convert POST requests back to CONNECT requests.
    //
    // Neither ``:``-prefixed pseudo-headers like ``:path`` nor the ``host`` header can be overridden.