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

Code before:
  // 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.
    repeated config.core.v3.HeaderValueOption headers_to_add = 3
        [(validate.rules).repeated = {max_items: 1000}];

    // Save response headers to the downstream connection's filter state for consumption
    // by network filters. The filter state key is ``envoy.tcp_proxy.propagate_response_headers``.
    bool propagate_response_headers = 4;

    // The path used with the POST method. The default path is ``/``. If this field is specified and
    // :ref:`use_post field <envoy_v3_api_field_extensions.filters.network.tcp_proxy.v3.TcpProxy.TunnelingConfig.use_post>`
    // is not set to true, the configuration will be rejected.
    string post_path = 5;

    // Save response trailers to the downstream connection's filter state for consumption
    // by network filters. The filter state key is ``envoy.tcp_proxy.propagate_response_trailers``.
    bool propagate_response_trailers = 6;


Review comment (suggestion):
```suggestion
    // Use the ``POST`` method instead of the ``CONNECT`` method to tunnel the TCP stream.
```

Code after:
  // 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.
    repeated config.core.v3.HeaderValueOption headers_to_add = 3
        [(validate.rules).repeated = {max_items: 1000}];

    // Save response headers to the downstream connection's filter state for consumption
    // by network filters. The filter state key is ``envoy.tcp_proxy.propagate_response_headers``.
    bool propagate_response_headers = 4;

    // The path used with the POST method. The default path is ``/``. If this field is specified and
    // :ref:`use_post field <envoy_v3_api_field_extensions.filters.network.tcp_proxy.v3.TcpProxy.TunnelingConfig.use_post>`
    // is not set to true, the configuration will be rejected.
    string post_path = 5;

    // Save response trailers to the downstream connection's filter state for consumption
    // by network filters. The filter state key is ``envoy.tcp_proxy.propagate_response_trailers``.
    bool propagate_response_trailers = 6;