<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
]>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.7.29 (Ruby 3.3.6) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-rosomakho-masque-reverse-connect-00" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.28.1 -->
  <front>
    <title>Reverse HTTP CONNECT for TCP and UDP</title>
    <seriesInfo name="Internet-Draft" value="draft-rosomakho-masque-reverse-connect-00"/>
    <author fullname="Yaroslav Rosomakho">
      <organization>Zscaler</organization>
      <address>
        <email>yrosomakho@zscaler.com</email>
      </address>
    </author>
    <date year="2025" month="April" day="25"/>
    <area/>
    <workgroup>Multiplexed Application Substrate over QUIC Encryption</workgroup>
    <keyword>quic</keyword>
    <keyword>http</keyword>
    <keyword>proxy</keyword>
    <keyword>reverse</keyword>
    <abstract>
      <?line 46?>

<t>This document specifies an extension to the HTTP CONNECT method, enabling a proxy client to accept inbound TCP and UDP sessions proxied through HTTP/1.1, HTTP/2, or HTTP/3. This mechanism allows the client to dynamically advertise available local or internal network services and expose them through a HTTP proxy without reliance on IP routing.</t>
    </abstract>
    <note removeInRFC="true">
      <name>About This Document</name>
      <t>
        The latest revision of this draft can be found at <eref target="https://yaroslavros.github.io/draft-masque-reverse-connect/draft-rosomakho-masque-reverse-connect.html"/>.
        Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-rosomakho-masque-reverse-connect/"/>.
      </t>
      <t>
        Discussion of this document takes place on the
        Multiplexed Application Substrate over QUIC Encryption  mailing list (<eref target="mailto:masque@ietf.org"/>),
        which is archived at <eref target="https://mailarchive.ietf.org/arch/browse/masque/"/>.
        Subscribe at <eref target="https://www.ietf.org/mailman/listinfo/masque/"/>.
      </t>
      <t>Source for this draft and an issue tracker can be found at
        <eref target="https://github.com/yaroslavros/draft-masque-reverse-connect"/>.</t>
    </note>
  </front>
  <middle>
    <?line 51?>

<section anchor="introduction">
      <name>Introduction</name>
      <t>Reverse HTTP CONNECT for TCP <xref target="TCP"/> and UDP <xref target="UDP"/> extends the traditional CONNECT method (see <xref section="9.3.6" sectionFormat="of" target="HTTP"/>) by enabling a proxy client to accept inbound TCP and UDP sessions proxied through HTTP/1.1 <xref target="H1"/>, HTTP/2 <xref target="H2"/>, or HTTP/3 <xref target="H3"/>. In contrast to the traditional CONNECT method, which establishes outbound sessions to remote servers, this extension facilitates inbound sessions to the proxy client, allowing access to local or internal services.</t>
      <t>Unlike Proxying IP in HTTP <xref target="CONNECT-IP"/>, this approach simplifies deployment in dynamic or constrained network environments by removing reliance on IP routing. By eliminating the need for  routing configurations, this approach reduces operational complexity and allows for easier integration in scenarios where traditional IP routing is impractical. On top of that, Reverse HTTP CONNECT reduces overhead as it does not carry IP or transport layer headers.</t>
      <t>Since Reverse HTTP CONNECT is built on top of existing HTTP transport, it can be efficiently combined with outbound CONNECT and other HTTP communications.</t>
      <t>The primary use cases for this extension include:</t>
      <ul spacing="normal">
        <li>
          <t><strong>Access to Local Services</strong>: A proxy client can expose its own local services by accepting inbound TCP or UDP sessions from an HTTP server. For example, this can enable remote management  or access to local application servers that can only be accessed through an outbound connection to the proxy.</t>
        </li>
      </ul>
      <figure anchor="local-services">
        <name>Accessing local client services</name>
        <artset>
          <artwork type="svg"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="128" width="472" viewBox="0 0 472 128" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
              <path d="M 8,32 L 8,112" fill="none" stroke="black"/>
              <path d="M 88,32 L 88,112" fill="none" stroke="black"/>
              <path d="M 360,32 L 360,112" fill="none" stroke="black"/>
              <path d="M 464,32 L 464,112" fill="none" stroke="black"/>
              <path d="M 8,32 L 88,32" fill="none" stroke="black"/>
              <path d="M 360,32 L 464,32" fill="none" stroke="black"/>
              <path d="M 72,48 L 120,48" fill="none" stroke="black"/>
              <path d="M 320,48 L 384,48" fill="none" stroke="black"/>
              <path d="M 80,64 L 144,64" fill="none" stroke="black"/>
              <path d="M 304,64 L 376,64" fill="none" stroke="black"/>
              <path d="M 80,80 L 144,80" fill="none" stroke="black"/>
              <path d="M 304,80 L 376,80" fill="none" stroke="black"/>
              <path d="M 72,96 L 384,96" fill="none" stroke="black"/>
              <path d="M 8,112 L 88,112" fill="none" stroke="black"/>
              <path d="M 360,112 L 464,112" fill="none" stroke="black"/>
              <path d="M 384,48 L 396,72" fill="none" stroke="black"/>
              <path d="M 384,96 L 396,72" fill="none" stroke="black"/>
              <polygon class="arrowhead" points="88,80 76,74.4 76,85.6" fill="black" transform="rotate(180,80,80)"/>
              <polygon class="arrowhead" points="88,64 76,58.4 76,69.6" fill="black" transform="rotate(180,80,64)"/>
              <g class="text">
                <text x="156" y="52">Outbound</text>
                <text x="212" y="52">HTTP</text>
                <text x="276" y="52">connection</text>
                <text x="40" y="68">Proxy</text>
                <text x="176" y="68">Inbound</text>
                <text x="224" y="68">TCP</text>
                <text x="272" y="68">session</text>
                <text x="424" y="68">Proxy</text>
                <text x="44" y="84">Client</text>
                <text x="176" y="84">Inbound</text>
                <text x="224" y="84">UDP</text>
                <text x="272" y="84">session</text>
                <text x="428" y="84">Server</text>
              </g>
            </svg>
          </artwork>
          <artwork type="ascii-art"><![CDATA[
+---------+                                 +------------+
|       --+----Outbound HTTP connection-----+--.         |
| Proxy  <+-------Inbound TCP session-------+-- \ Proxy  |
| Client <+-------Inbound UDP session-------+-- / Server |
|       --+---------------------------------+--'         |
+---------+                                 +------------+
]]></artwork>
        </artset>
      </figure>
      <ul spacing="normal">
        <li>
          <t><strong>Gateway to Internal Networks</strong>: A proxy client acts as a gateway, facilitating access to internal network services provided over TCP or UDP sessions. In this scenario, the proxy client forwards incoming session originating from an HTTP server to specific internal services, enabling secure communication with private network resources.</t>
        </li>
      </ul>
      <figure anchor="internal-services">
        <name>Accessing internal services through client</name>
        <artset>
          <artwork type="svg"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="160" width="584" viewBox="0 0 584 160" class="diagram" text-anchor="middle" font-family="monospace" font-size="13px" stroke-linecap="round">
              <path d="M 8,48 L 8,96" fill="none" stroke="black"/>
              <path d="M 24,64 L 24,112" fill="none" stroke="black"/>
              <path d="M 40,80 L 40,128" fill="none" stroke="black"/>
              <path d="M 96,48 L 96,64" fill="none" stroke="black"/>
              <path d="M 112,64 L 112,80" fill="none" stroke="black"/>
              <path d="M 128,80 L 128,128" fill="none" stroke="black"/>
              <path d="M 168,32 L 168,144" fill="none" stroke="black"/>
              <path d="M 240,32 L 240,144" fill="none" stroke="black"/>
              <path d="M 472,64 L 472,144" fill="none" stroke="black"/>
              <path d="M 576,64 L 576,144" fill="none" stroke="black"/>
              <path d="M 168,32 L 240,32" fill="none" stroke="black"/>
              <path d="M 8,48 L 96,48" fill="none" stroke="black"/>
              <path d="M 24,64 L 112,64" fill="none" stroke="black"/>
              <path d="M 472,64 L 576,64" fill="none" stroke="black"/>
              <path d="M 40,80 L 128,80" fill="none" stroke="black"/>
              <path d="M 208,80 L 256,80" fill="none" stroke="black"/>
              <path d="M 456,80 L 496,80" fill="none" stroke="black"/>
              <path d="M 8,96 L 24,96" fill="none" stroke="black"/>
              <path d="M 136,96 L 280,96" fill="none" stroke="black"/>
              <path d="M 440,96 L 488,96" fill="none" stroke="black"/>
              <path d="M 24,112 L 40,112" fill="none" stroke="black"/>
              <path d="M 136,112 L 280,112" fill="none" stroke="black"/>
              <path d="M 440,112 L 488,112" fill="none" stroke="black"/>
              <path d="M 40,128 L 128,128" fill="none" stroke="black"/>
              <path d="M 208,128 L 496,128" fill="none" stroke="black"/>
              <path d="M 168,144 L 240,144" fill="none" stroke="black"/>
              <path d="M 472,144 L 576,144" fill="none" stroke="black"/>
              <path d="M 496,80 L 508,104" fill="none" stroke="black"/>
              <path d="M 496,128 L 508,104" fill="none" stroke="black"/>
              <polygon class="arrowhead" points="216,112 204,106.4 204,117.6" fill="black" transform="rotate(180,208,112)"/>
              <polygon class="arrowhead" points="216,96 204,90.4 204,101.6" fill="black" transform="rotate(180,208,96)"/>
              <polygon class="arrowhead" points="144,112 132,106.4 132,117.6" fill="black" transform="rotate(180,136,112)"/>
              <polygon class="arrowhead" points="144,96 132,90.4 132,101.6" fill="black" transform="rotate(180,136,96)"/>
              <g class="text">
                <text x="200" y="52">Proxy</text>
                <text x="204" y="68">Client</text>
                <text x="292" y="84">Outbound</text>
                <text x="348" y="84">HTTP</text>
                <text x="412" y="84">connection</text>
                <text x="84" y="100">Internal</text>
                <text x="312" y="100">Inbound</text>
                <text x="360" y="100">TCP</text>
                <text x="408" y="100">session</text>
                <text x="536" y="100">Proxy</text>
                <text x="84" y="116">Services</text>
                <text x="312" y="116">Inbound</text>
                <text x="360" y="116">UDP</text>
                <text x="408" y="116">session</text>
                <text x="540" y="116">Server</text>
              </g>
            </svg>
          </artwork>
          <artwork type="ascii-art"><![CDATA[
                    +--------+
.----------.        | Proxy  |
| .--------+-.      | Client |                            +------------+
| | .--------+-.    |    ----+--Outbound HTTP connection--+--.         |
'-+ | Internal |<---+----<---+-----Inbound TCP session----+-- \ Proxy  |
  '-+ Services |<---+----<---+-----Inbound UDP session----+-- / Server |
    '----------'    |    ----+----------------------------+--'         |
                    +--------+                            +------------+
]]></artwork>
        </artset>
      </figure>
      <t>As explained in the specification both use cases can be combined on the same proxy client.</t>
    </section>
    <section anchor="conventions-and-definitions">
      <name>Conventions and Definitions</name>
      <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL
NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>",
"<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/> when, and only when, they
appear in all capitals, as shown here.</t>
      <?line -18?>

</section>
    <section anchor="client-configuration">
      <name>Client Configuration</name>
      <t>To use a Reverse Connect proxy HTTP clients are configured with two URI Templates <xref target="TEMPLATE"/>:</t>
      <ul spacing="normal">
        <li>
          <t>Listener Control Channel described in <xref target="listener-template"/></t>
        </li>
        <li>
          <t>Accepting Connection Requests described in <xref target="accepting-connection"/>.</t>
        </li>
      </ul>
    </section>
    <section anchor="listener-control-channel">
      <name>Listener Control Channel</name>
      <t>The Listener Control Channel enables the HTTP server to request the establishment of inbound TCP or UDP sessions on the proxy client. This is necessary because the HTTP protocol inherently expects the client to initiate connections. To address this, the Listener Control Channel uses the Capsule Protocol (see <xref section="3.2" sectionFormat="of" target="HTTP-DGRAM"/>) to carry connection requests from the server to the client.</t>
      <t>Additionally, the Listener Control Channel can carry optional Service Discovery Capsules, which allow the proxy client to advertise available local or internal services to the HTTP server. This feature facilitates dynamic service discovery and ensures that the server has up-to-date information about the services accessible through the proxy client.</t>
      <section anchor="listener-template">
        <name>Listener Control Channel URI Template</name>
        <t>The Listener Control Channel template is similar to the one defined in <xref section="3" sectionFormat="of" target="CONNECT-IP"/> and it <bcp14>MAY</bcp14> contain two variables: "target" and "ipproto". These variables are used to define the scope of network services that the client accepts connectivity for.</t>
        <t>Examples are shown below:</t>
        <figure anchor="fig-listen-template-examples">
          <name>Listener Control Channel URI Template Examples</name>
          <artwork><![CDATA[
https://example.org/.well-known/masque/listen/{target}/{ipproto}/
https://proxy.example.org:4443/masque/listen?t={target}&i={ipproto}
https://proxy.example.org:4443/masque/listen{?target,ipproto}
https://masque.example.org/?user=bob
]]></artwork>
        </figure>
        <t>All template requirements listed in <xref section="3" sectionFormat="of" target="CONNECT-IP"/> apply here.</t>
        <t>If set, the variable "target" <bcp14>MUST</bcp14> contain one of the following values:</t>
        <ul spacing="normal">
          <li>
            <t>A hostname according to <xref section="4.6" sectionFormat="of" target="CONNECT-IP"/></t>
          </li>
          <li>
            <t>IPv4 or IPv6 prefix according to <xref section="4.6" sectionFormat="of" target="CONNECT-IP"/></t>
          </li>
          <li>
            <t>"*" that does not limit scope</t>
          </li>
          <li>
            <t>A wildcard: a domain name prefixed by "*.". This implies that client <bcp14>MAY</bcp14> accept inbound sessions for any host in a given domain</t>
          </li>
          <li>
            <t>"." which means that the client will accept sessions to local services only and will not forward to other hosts</t>
          </li>
        </ul>
        <t>If set, the variable "ipproto" <bcp14>MUST</bcp14> contain one of the following values:</t>
        <ul spacing="normal">
          <li>
            <t>"6" which means that the client will only accept TCP sessions.</t>
          </li>
          <li>
            <t>"17" which means that the client will only accept UDP sessions.</t>
          </li>
          <li>
            <t>"*" which means that the client will accept both TCP and UDP sessions.</t>
          </li>
        </ul>
        <t>As with <xref target="CONNECT-IP"/>, some client configurations for Reverse Connect proxies will only allow
the user to configure the proxy host and proxy port. Clients with such
limitations <bcp14>MAY</bcp14> attempt to access proxying capabilities using the default
template, which is defined as:
"https://$PROXY_HOST:$PROXY_PORT/.well-known/masque/listen/{target}/{ipproto}/",
where $PROXY_HOST and $PROXY_PORT are the configured host and port of the
proxy, respectively. Reverse Connect proxy deployments <bcp14>SHOULD</bcp14> offer service at this location
if they need to interoperate with such clients.</t>
      </section>
      <section anchor="establishing-listener-control-channel-over-http11">
        <name>Establishing Listener Control Channel over HTTP/1.1</name>
        <t>When establishing the Listener Control Channel using HTTP/1.1 <xref target="H1"/>, the client follows the requirements from <xref section="4.2" sectionFormat="of" target="CONNECT-IP"/> but uses "connect-listen" as the value for the Upgrade header.</t>
        <t>For example, the client configured with the default URI Template "https://example.org/.well-known/masque/listen/{target}/{ipproto}/" can establish the Listener Control Channel for local TCP and UDP services by sending the following request:</t>
        <figure anchor="fig-req-h1">
          <name>Example HTTP/1.1 Request</name>
          <sourcecode type="http-message"><![CDATA[
GET https://example.org/.well-known/masque/listen/./*/ HTTP/1.1
Host: example.org
Connection: Upgrade
Upgrade: connect-listen
Capsule-Protocol: ?1
]]></sourcecode>
        </figure>
        <t>The server confirms successful registration of the client as described in <xref section="4.3" sectionFormat="of" target="CONNECT-IP"/>, but with "connect-listen" for the value for Upgrade header.</t>
        <t>An example of the server confirming successful registration of the client is provided below:</t>
        <figure anchor="fig-resp-h1">
          <name>Example HTTP/1.1 Response</name>
          <sourcecode type="http-message"><![CDATA[
HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: connect-listen
Capsule-Protocol: ?1
]]></sourcecode>
        </figure>
      </section>
      <section anchor="establishing-listener-control-channel-over-http2-and-http3">
        <name>Establishing Listener Control Channel over HTTP/2 and HTTP/3</name>
        <t>When establishing Listener Control Channel using HTTP/2 <xref target="H2"/> or HTTP/3 <xref target="H3"/>, the client follows requirements from <xref section="4.4" sectionFormat="of" target="CONNECT-IP"/>, but uses "connect-listen" as the value for :protocol pseudo-header.</t>
        <t>For example, the client configured with the default URI Template "https://example.org/.well-known/masque/listen/{target}/{ipproto}/" can establish the Listener Control Channel for local TCP and UDP services by sending the following request:</t>
        <figure anchor="fig-req-h2">
          <name>Example HTTP/2 or HTTP/3 Request</name>
          <sourcecode type="http-message"><![CDATA[
HEADERS
:method = CONNECT
:protocol = connect-listen
:scheme = https
:path = /.well-known/masque/listen/./*/
:authority = example.org
capsule-protocol = ?1
]]></sourcecode>
        </figure>
        <t>The server indicates a successful registration of the client as described in <xref section="4.5" sectionFormat="of" target="CONNECT-IP"/>.</t>
        <t>Example of server confirming successful registration of the client is provided below:</t>
        <figure anchor="fig-resp-h2">
          <name>Example HTTP/2 or HTTP/3 Response</name>
          <sourcecode type="http-message"><![CDATA[
HEADERS
:status = 200
capsule-protocol = ?1
]]></sourcecode>
        </figure>
      </section>
      <section anchor="service-discovery">
        <name>Service Discovery</name>
        <t>The Reverse Connect client <bcp14>MAY</bcp14> advertise offered TCP and UDP services to the proxy server through the AVAILABLE_SERVICES Capsule over the established Listener Control Channel. This information serves as a hint for the proxy server and does not constrain the server from attempting to establish sessions with services that were not advertised. The presence of a service in the AVAILABLE_SERVICES list does not guarantee actual service availability, as the client may not be able to track the health of the service.</t>
        <t>Capsule format for AVAILABLE_SERVICES is the following:</t>
        <figure anchor="available-services-format">
          <name>AVAILABLE_SERVICES Capsule Format</name>
          <artwork><![CDATA[
AVAILABLE_SERVICES Capsule {
  Type (i) = 0xTBD,
  Length (i),
  Service (..) ...,
}
]]></artwork>
        </figure>
        <t>The AVAILABLE_SERVICES capsule contains a sequence of zero or more Services.</t>
        <figure anchor="service-format">
          <name>Service Format</name>
          <artwork><![CDATA[
Service {
  Destination Type (8),
  Destination (..),
  Protocol (8),
  Port (16),
}
]]></artwork>
        </figure>
        <t>Each service record represents potential connection destination and contains the following fields:</t>
        <dl>
          <dt>Destination Type:</dt>
          <dd>
            <t>A single byte value defining type and format of Destination field. Valid destination types are:</t>
          </dd>
        </dl>
        <ul spacing="normal">
          <li>
            <t>0: Destination is local for the client.</t>
          </li>
          <li>
            <t>1: Destination is specified by a hostname.</t>
          </li>
          <li>
            <t>4: Destination is specified by an IPv4 address.</t>
          </li>
          <li>
            <t>6: Destination is specified by an IPv6 address.</t>
          </li>
        </ul>
        <dl>
          <dt>Destination:</dt>
          <dd>
            <t>Content of the Destination field is determined by the Destination Type. For local destination type destination is omitted. IPv4 destination carries 32 bits of IPv4 address. IPv6 destination carries 128 bits of IPv6 address. Hostname destination (destination type 1) is provided in the following format:</t>
          </dd>
        </dl>
        <figure anchor="hostname-destination-format">
          <name>Hostname Destination Format</name>
          <artwork><![CDATA[
Hostname_Destination {
  Length (i),
  Hostname (..),
}
]]></artwork>
        </figure>
        <t>Length is encoded as a variable-length integer and Hostname contains the hostname string.</t>
        <dl>
          <dt>Protocol:</dt>
          <dd>
            <t>A single byte value of 6 for TCP and 17 for UDP.</t>
          </dd>
          <dt>Port:</dt>
          <dd>
            <t>Two bytes value of target TCP or UDP port.</t>
          </dd>
        </dl>
        <t>AVAILABLE_SERVICES messages are not incremental. A new message completely overwrites the previous hint.</t>
        <t>If any of the capsule fields are malformed upon reception, the server <bcp14>MUST</bcp14> follow the error-handling procedure defined in <xref section="3.3" sectionFormat="of" target="HTTP-DGRAM"/>.</t>
      </section>
    </section>
    <section anchor="connection-lifecycle">
      <name>Connection Lifecycle</name>
      <section anchor="requesting-connection">
        <name>Requesting Connection</name>
        <t>To request a new outbound connection from the client for an inbound TCP or UDP session, the server sends a CONNECTION_REQUEST Capsule. The CONNECTION_REQUEST Capsule is defined as follows:</t>
        <figure anchor="connection-request-format">
          <name>CONNECTION_REQUEST Capsule Format</name>
          <artwork><![CDATA[
CONNECTION_REQUEST Capsule {
  Type (i) = 0xTBD,
  Length (i),
  Request ID (i),
  Service (..),
}
]]></artwork>
        </figure>
        <dl>
          <dt>Request ID:</dt>
          <dd>
            <t>A unique request identifier, encoded as a variable-length integer. The Request ID <bcp14>MUST</bcp14> be unique for a given Listener Control Channel.</t>
          </dd>
          <dt>Service:</dt>
          <dd>
            <t>Session destination as described in <xref target="service-discovery"/>.</t>
          </dd>
        </dl>
        <t>If any of the capsule fields are malformed upon reception, or if the Request ID has been previously used on the same Listener Control Channel, the client <bcp14>MUST</bcp14> follow the error-handling procedure defined in <xref section="3.3" sectionFormat="of" target="HTTP-DGRAM"/>.</t>
        <t>If the client declines the connection request it responds with a CONNECTION_REQUEST_DECLINED Capsule in the following format:</t>
        <figure anchor="connection-request-declined-format">
          <name>CONNECTION_REQUEST_DECLINED Capsule Format</name>
          <artwork><![CDATA[
CONNECTION_REQUEST_DECLINED Capsule {
  Type (i) = 0xTBD,
  Length (i),
  Request ID (i),
}
]]></artwork>
        </figure>
        <t>If any of the capsule fields are malformed upon reception, or if the  Request ID does not correspond to an outstanding CONNECTION_REQUEST on the same Listener Control Channel, the server <bcp14>MUST</bcp14> follow the error-handling procedure defined in <xref section="3.3" sectionFormat="of" target="HTTP-DGRAM"/>.</t>
      </section>
      <section anchor="accepting-connection">
        <name>Accepting Connection</name>
        <t>To accept the inbound session, the client sends a new outbound request to the server. This request uses an Accepting Connection URI Template <xref target="TEMPLATE"/>. The URI Template <bcp14>MUST</bcp14> contain "request_id" variable.</t>
        <t>Examples are shown below:</t>
        <figure anchor="fig-accepting-template-examples">
          <name>Accepting Connection URI Template Examples</name>
          <artwork><![CDATA[
https://example.org/.well-known/masque/accept/{request_id}/
https://proxy.example.org:4443/masque/accept?id={request_id}
https://proxy.example.org:4443/masque/accept{?request_id}
https://masque.example.org/?user=bob&request_id={request_id}
]]></artwork>
        </figure>
        <t>The following requirements apply to the Accepting Connection URI Template:</t>
        <ul spacing="normal">
          <li>
            <t>The URI Template <bcp14>MUST</bcp14> be a level 3 template or lower.</t>
          </li>
          <li>
            <t>The URI Template <bcp14>MUST</bcp14> be in absolute form and <bcp14>MUST</bcp14> include non-empty scheme, authority, and path components.</t>
          </li>
          <li>
            <t>The path component of the URI Template <bcp14>MUST</bcp14> start with a slash "/".</t>
          </li>
          <li>
            <t>All template variables <bcp14>MUST</bcp14> be within the path or query components of the URI.</t>
          </li>
          <li>
            <t>The URI Template <bcp14>MUST</bcp14> contain variable "request_id" and <bcp14>MAY</bcp14> contain other variables.</t>
          </li>
          <li>
            <t>The URI Template <bcp14>MUST NOT</bcp14> contain any non-ASCII Unicode characters and <bcp14>MUST</bcp14> only contain ASCII characters in the range 0x21-0x7E inclusive (note that percent-encoding is allowed; see <xref section="2.1" sectionFormat="of" target="URI"/>.</t>
          </li>
          <li>
            <t>The URI Template <bcp14>MUST NOT</bcp14> use Reserved Expansion ("+" operator), Fragment Expansion ("#" operator), Label Expansion with Dot-Prefix, Path Segment Expansion with Slash-Prefix, nor Path-Style Parameter Expansion with Semicolon-Prefix.</t>
          </li>
        </ul>
        <t>Clients <bcp14>SHOULD</bcp14> validate the requirements above; however, clients <bcp14>MAY</bcp14> use a general-purpose URI Template implementation that lacks this specific validation.  If a client detects that any of the requirements above are not met by a URI Template, the client <bcp14>MUST</bcp14> reject its configuration and abort the request without sending it to the IP proxy.</t>
        <t>As with <xref target="CONNECT-IP"/>, some client configurations for Reverse Connect proxies will only allow
the user to configure the proxy host and proxy port. Clients with such
limitations <bcp14>MAY</bcp14> attempt to access proxying capabilities using the default
template, which is defined as:
"https://$PROXY_HOST:$PROXY_PORT/.well-known/masque/accept/{request_id}/",
where $PROXY_HOST and $PROXY_PORT are the configured host and port of the
proxy, respectively. Reverse Connect proxy deployments <bcp14>SHOULD</bcp14> offer service at this location
if they need to interoperate with such clients.</t>
        <section anchor="accepting-connection-over-http11">
          <name>Accepting Connection over HTTP/1.1</name>
          <t>When accepting an inbound session over HTTP/1.1 <xref target="H1"/>, the client sends to the proxy a new request as follows:</t>
          <ul spacing="normal">
            <li>
              <t>The method <bcp14>SHALL</bcp14> be "GET"</t>
            </li>
            <li>
              <t>The request <bcp14>SHALL</bcp14> include a single "Host" header field containing the origin of the proxy.</t>
            </li>
            <li>
              <t>The request <bcp14>SHALL</bcp14> include a "Connection" header field with the value "Upgrade" (note that this requirement is case-insensitive as per <xref section="7.6.1" sectionFormat="of" target="HTTP"/>).</t>
            </li>
            <li>
              <t>The request <bcp14>SHALL</bcp14> include an Upgrade header field with value "connect-accept".</t>
            </li>
          </ul>
          <t>A request that does not match the above restrictions is considered malformed. A proxy server receiving a malformed request <bcp14>MUST</bcp14> respond with an error and <bcp14>SHOULD</bcp14> use the 400 (Bad Request) status code. If <tt>request_id</tt> template variable is not matching an outstanding connection request for given client, proxy server <bcp14>MUST</bcp14> respond with an error and <bcp14>SHOULD</bcp14> use the 404 (Not Found) status code.</t>
          <t>The proxy <bcp14>SHALL</bcp14> indicate a successful response by replying with the following requirements:</t>
          <ul spacing="normal">
            <li>
              <t>The HTTP status code on the response <bcp14>SHALL</bcp14> be 101 (Switching Protocols).</t>
            </li>
            <li>
              <t>The response <bcp14>SHALL</bcp14> include a Connection header field with value "Upgrade" (note that this requirement is case-insensitive as per <xref section="7.6.1" sectionFormat="of" target="HTTP"/>).</t>
            </li>
            <li>
              <t>The response <bcp14>SHALL</bcp14> include a single Upgrade header with value "connect-accept".</t>
            </li>
            <li>
              <t>The response <bcp14>SHALL</bcp14> meet the requirements of HTTP responses that start the Capsule Protocol according to <xref section="3.2" sectionFormat="of" target="HTTP-DGRAM"/>.</t>
            </li>
          </ul>
          <t>A response that does not match these requirements <bcp14>MUST</bcp14> be treated as failed and corresponding connection <bcp14>MUST</bcp14> be aborted by the client.</t>
          <t>For example, the client configured with the URI Template "https://example.org/.well-known/masque/accept/{request_id}/" can accept the inbound Connection as a response to a connection request with Request ID 1:</t>
          <figure anchor="fig-req-accept-h1">
            <name>Example HTTP/1.1 Request Accepting Connection</name>
            <sourcecode type="http-message"><![CDATA[
GET https://example.org/.well-known/masque/accept/1/ HTTP/1.1
Host: example.org
Connection: Upgrade
Upgrade: connect-accept
Capsule-Protocol: ?1
]]></sourcecode>
          </figure>
          <t>The proxy server could respond with the following:</t>
          <figure anchor="fig-resp-accept-h1">
            <name>Example HTTP/1.1 Response Accepting Connection</name>
            <sourcecode type="http-message"><![CDATA[
HTTP/1.1 101 Switching Protocols
Connection: Upgrade
Upgrade: connect-accept
Capsule-Protocol: ?1
]]></sourcecode>
          </figure>
        </section>
        <section anchor="accepting-connection-over-http2-and-http3">
          <name>Accepting Connection over HTTP/2 and HTTP/3</name>
          <t>When accepting an inbound sessions over HTTP/2 <xref target="H2"/> or HTTP/3 <xref target="H3"/>, the client sends to the proxy a request on a new Stream of the connection that carries the Listener Control Channel as follows:</t>
          <ul spacing="normal">
            <li>
              <t>The :method pseudo-header field <bcp14>SHALL</bcp14> be "CONNECT".</t>
            </li>
            <li>
              <t>The :protocol pseudo-header field <bcp14>SHALL</bcp14> be "connect-accept".</t>
            </li>
            <li>
              <t>The :authority pseudo-header field <bcp14>SHALL</bcp14> contain the authority of the proxy.</t>
            </li>
            <li>
              <t>The :path and :scheme pseudo-header fields <bcp14>SHALL</bcp14> contain the path and scheme of the request URI derived from the Accepting Connection URI template for the proxy.</t>
            </li>
          </ul>
          <t>A request that does not match the above restrictions is considered malformed. A proxy server receiving a malformed request <bcp14>MUST</bcp14> respond with an error and <bcp14>SHOULD</bcp14> use the 400 (Bad Request) status code. If "request_id" template variable is not matching an outstanding connection request for given client, proxy server <bcp14>MUST</bcp14> respond with an error and <bcp14>SHOULD</bcp14> use the 404 (Not Found) status code.</t>
          <t>The proxy <bcp14>SHALL</bcp14> indicate a successful response by replying with the following requirements:</t>
          <ul spacing="normal">
            <li>
              <t>The HTTP status code on the response <bcp14>SHALL</bcp14> be in 2xx (Successful) range.</t>
            </li>
            <li>
              <t>The response <bcp14>SHALL</bcp14> meet the requirements of HTTP responses that start the Capsule Protocol according to <xref section="3.2" sectionFormat="of" target="HTTP-DGRAM"/>.</t>
            </li>
          </ul>
          <t>A response that does not match these requirements <bcp14>MUST</bcp14> be treated as failed and corresponding connection <bcp14>MUST</bcp14> be aborted by the client.</t>
          <t>For example, the client configured with the URI Template "https://example.org/.well-known/masque/accept/{request_id}/" can accept the inbound session as a response to a connection request with Request ID 1:</t>
          <figure anchor="fig-req-accept-h2">
            <name>Example HTTP/2 or HTTP/3 Request Accepting Connection</name>
            <sourcecode type="http-message"><![CDATA[
HEADERS
:method = CONNECT
:protocol = connect-accept
:scheme = https
:path = /.well-known/masque/accept/1/
:authority = example.org
capsule-Protocol = ?1
]]></sourcecode>
          </figure>
          <t>The proxy server could respond with the following:</t>
          <figure anchor="fig-resp-accept-h2">
            <name>Example HTTP/2 or HTTP/3 Response Accepting Connection</name>
            <sourcecode type="http-message"><![CDATA[
HEADERS
:status = 200
capsule-Protocol = ?1
]]></sourcecode>
          </figure>
        </section>
      </section>
      <section anchor="establishing-connection">
        <name>Establishing Connection</name>
        <t>Once the client receives a successful response from the proxy for the request accepting the connection it establishes the requested TCP or UDP socket to a local or internal destination. If the socket failed to establish, the client <bcp14>MUST</bcp14> immediately close the request stream.</t>
        <t>For TCP flows, communicating parties carry TCP payload data in the payload of DATA Capsules over the established stream according to <xref section="8.3" sectionFormat="of" target="Template-TCPCONNECT"/>. Either party <bcp14>MAY</bcp14> close the stream if TCP connection is terminated.</t>
        <t>UDP data is carried in DATAGRAM capsules or encoded in QUIC DATAGRAM frames as explained in <xref section="5" sectionFormat="of" target="CONNECT-UDP"/>. The lifetime of the UDP socket is tied to the request stream as described in <xref section="3.1" sectionFormat="of" target="CONNECT-UDP"/>.</t>
      </section>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>Proxy servers providing Reverse HTTP Connect services <bcp14>MUST</bcp14> restrict their services to authenticated users. An unauthorized user accepting an inbound session from the proxy server may cause availability risks and compromise the wider systems by misrouting communications. Clients that advertise services through the AVAILABLE_SERVICES Capsule may inadvertently expose sensitive or private services. Proxy servers <bcp14>MUST</bcp14> verify that advertised services comply with organizational security policies.</t>
      <t>To avoid exposing local or internal services to unauthorized parties, clients <bcp14>MUST</bcp14> confirm identity of the proxy service that they connect to and allow inbound sessions only to services that should be accessible from the proxy.</t>
      <t>Proxies providing Reverse HTTP Connect service over HTTP/1.1 <bcp14>MUST</bcp14> consistently authenticate clients on both Listener Control Channel and individual Connection Acceptance Requests. To minimize the risks of misrouting connection request to a rogue client, HTTP/1.1 Reverse Connect proxies <bcp14>SHOULD</bcp14> generate Request ID randomly instead of using a predictable sequence.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="http-upgrade-tokens">
        <name> HTTP Upgrade Tokens</name>
        <t>IF APPROVED, IANA is requested to add the following entries to the HTTP Upgrade Token Registry:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">"connect-listen"</td>
              <td align="left">Listening for inbound connection requests</td>
              <td align="left">(This document)</td>
            </tr>
            <tr>
              <td align="left">"connect-accept"</td>
              <td align="left">Accepting an inbound connection request</td>
              <td align="left">(This document)</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="new-masque-default-templates">
        <name> New MASQUE Default Templates</name>
        <t>IF APPROVED, IANA is requested to add the following entries to the MASQUE URI Suffixes Registry:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Description</th>
              <th align="left">Reference</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">"listen"</td>
              <td align="left">Listening for inbound connection requests</td>
              <td align="left">(This document)</td>
            </tr>
            <tr>
              <td align="left">"accept"</td>
              <td align="left">Accepting an inbound connection request</td>
              <td align="left">(This document)</td>
            </tr>
          </tbody>
        </table>
      </section>
      <section anchor="new-http-capsule-types">
        <name> New HTTP Capsule Types</name>
        <t>IF APPROVED, IANA is requested to add the following entries to the HTTP Capsule Types Registry:</t>
        <table>
          <thead>
            <tr>
              <th align="left">Value</th>
              <th align="left">Capsule Type</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td align="left">(TBD)</td>
              <td align="left">AVAILABLE_SERVICES</td>
            </tr>
            <tr>
              <td align="left">(TBD)</td>
              <td align="left">CONNECTION_REQUEST</td>
            </tr>
            <tr>
              <td align="left">(TBD)</td>
              <td align="left">CONNECTION_REQUEST_DECLINED</td>
            </tr>
          </tbody>
        </table>
        <t>All of these new entries use the following values for these fields:</t>
        <t>Status: permanent
Reference: (this document)
Change Controller: IETF
Contact: MASQUE
Notes: None</t>
      </section>
    </section>
  </middle>
  <back>
    <displayreference target="H1" to="HTTP/1.1"/>
    <displayreference target="H2" to="HTTP/2"/>
    <displayreference target="H3" to="HTTP/3"/>
    <references anchor="sec-normative-references">
      <name>Normative References</name>
      <reference anchor="H1">
        <front>
          <title>HTTP/1.1</title>
          <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
          <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
          <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
          <date month="June" year="2022"/>
          <abstract>
            <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document specifies the HTTP/1.1 message syntax, message parsing, connection management, and related security concerns.</t>
            <t>This document obsoletes portions of RFC 7230.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="99"/>
        <seriesInfo name="RFC" value="9112"/>
        <seriesInfo name="DOI" value="10.17487/RFC9112"/>
      </reference>
      <reference anchor="H2">
        <front>
          <title>HTTP/2</title>
          <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson"/>
          <author fullname="C. Benfield" initials="C." role="editor" surname="Benfield"/>
          <date month="June" year="2022"/>
          <abstract>
            <t>This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2). HTTP/2 enables a more efficient use of network resources and a reduced latency by introducing field compression and allowing multiple concurrent exchanges on the same connection.</t>
            <t>This document obsoletes RFCs 7540 and 8740.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9113"/>
        <seriesInfo name="DOI" value="10.17487/RFC9113"/>
      </reference>
      <reference anchor="H3">
        <front>
          <title>HTTP/3</title>
          <author fullname="M. Bishop" initials="M." role="editor" surname="Bishop"/>
          <date month="June" year="2022"/>
          <abstract>
            <t>The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment. This document describes a mapping of HTTP semantics over QUIC. This document also identifies HTTP/2 features that are subsumed by QUIC and describes how HTTP/2 extensions can be ported to HTTP/3.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9114"/>
        <seriesInfo name="DOI" value="10.17487/RFC9114"/>
      </reference>
      <reference anchor="TCP">
        <front>
          <title>Transmission Control Protocol</title>
          <author fullname="J. Postel" initials="J." surname="Postel"/>
          <date month="September" year="1981"/>
        </front>
        <seriesInfo name="RFC" value="793"/>
        <seriesInfo name="DOI" value="10.17487/RFC0793"/>
      </reference>
      <reference anchor="UDP">
        <front>
          <title>User Datagram Protocol</title>
          <author fullname="J. Postel" initials="J." surname="Postel"/>
          <date month="August" year="1980"/>
        </front>
        <seriesInfo name="STD" value="6"/>
        <seriesInfo name="RFC" value="768"/>
        <seriesInfo name="DOI" value="10.17487/RFC0768"/>
      </reference>
      <reference anchor="HTTP">
        <front>
          <title>HTTP Semantics</title>
          <author fullname="R. Fielding" initials="R." role="editor" surname="Fielding"/>
          <author fullname="M. Nottingham" initials="M." role="editor" surname="Nottingham"/>
          <author fullname="J. Reschke" initials="J." role="editor" surname="Reschke"/>
          <date month="June" year="2022"/>
          <abstract>
            <t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems. This document describes the overall architecture of HTTP, establishes common terminology, and defines aspects of the protocol that are shared by all versions. In this definition are core protocol elements, extensibility mechanisms, and the "http" and "https" Uniform Resource Identifier (URI) schemes.</t>
            <t>This document updates RFC 3864 and obsoletes RFCs 2818, 7231, 7232, 7233, 7235, 7538, 7615, 7694, and portions of 7230.</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="97"/>
        <seriesInfo name="RFC" value="9110"/>
        <seriesInfo name="DOI" value="10.17487/RFC9110"/>
      </reference>
      <reference anchor="CONNECT-IP">
        <front>
          <title>Proxying IP in HTTP</title>
          <author fullname="T. Pauly" initials="T." role="editor" surname="Pauly"/>
          <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
          <author fullname="A. Chernyakhovsky" initials="A." surname="Chernyakhovsky"/>
          <author fullname="M. Kühlewind" initials="M." surname="Kühlewind"/>
          <author fullname="M. Westerlund" initials="M." surname="Westerlund"/>
          <date month="October" year="2023"/>
          <abstract>
            <t>This document describes how to proxy IP packets in HTTP. This protocol is similar to UDP proxying in HTTP but allows transmitting arbitrary IP packets. More specifically, this document defines a protocol that allows an HTTP client to create an IP tunnel through an HTTP server that acts as an IP proxy. This document updates RFC 9298.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9484"/>
        <seriesInfo name="DOI" value="10.17487/RFC9484"/>
      </reference>
      <reference anchor="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner"/>
          <date month="March" year="1997"/>
          <abstract>
            <t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents. This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="2119"/>
        <seriesInfo name="DOI" value="10.17487/RFC2119"/>
      </reference>
      <reference anchor="RFC8174">
        <front>
          <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
          <author fullname="B. Leiba" initials="B." surname="Leiba"/>
          <date month="May" year="2017"/>
          <abstract>
            <t>RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.</t>
          </abstract>
        </front>
        <seriesInfo name="BCP" value="14"/>
        <seriesInfo name="RFC" value="8174"/>
        <seriesInfo name="DOI" value="10.17487/RFC8174"/>
      </reference>
      <reference anchor="TEMPLATE">
        <front>
          <title>URI Template</title>
          <author fullname="J. Gregorio" initials="J." surname="Gregorio"/>
          <author fullname="R. Fielding" initials="R." surname="Fielding"/>
          <author fullname="M. Hadley" initials="M." surname="Hadley"/>
          <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
          <author fullname="D. Orchard" initials="D." surname="Orchard"/>
          <date month="March" year="2012"/>
          <abstract>
            <t>A URI Template is a compact sequence of characters for describing a range of Uniform Resource Identifiers through variable expansion. This specification defines the URI Template syntax and the process for expanding a URI Template into a URI reference, along with guidelines for the use of URI Templates on the Internet. [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="6570"/>
        <seriesInfo name="DOI" value="10.17487/RFC6570"/>
      </reference>
      <reference anchor="HTTP-DGRAM">
        <front>
          <title>HTTP Datagrams and the Capsule Protocol</title>
          <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
          <author fullname="L. Pardue" initials="L." surname="Pardue"/>
          <date month="August" year="2022"/>
          <abstract>
            <t>This document describes HTTP Datagrams, a convention for conveying multiplexed, potentially unreliable datagrams inside an HTTP connection.</t>
            <t>In HTTP/3, HTTP Datagrams can be sent unreliably using the QUIC DATAGRAM extension. When the QUIC DATAGRAM frame is unavailable or undesirable, HTTP Datagrams can be sent using the Capsule Protocol, which is a more general convention for conveying data in HTTP connections.</t>
            <t>HTTP Datagrams and the Capsule Protocol are intended for use by HTTP extensions, not applications.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9297"/>
        <seriesInfo name="DOI" value="10.17487/RFC9297"/>
      </reference>
      <reference anchor="URI">
        <front>
          <title>Uniform Resource Identifier (URI): Generic Syntax</title>
          <author fullname="T. Berners-Lee" initials="T." surname="Berners-Lee"/>
          <author fullname="R. Fielding" initials="R." surname="Fielding"/>
          <author fullname="L. Masinter" initials="L." surname="Masinter"/>
          <date month="January" year="2005"/>
          <abstract>
            <t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource. This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet. The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier. This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme. [STANDARDS-TRACK]</t>
          </abstract>
        </front>
        <seriesInfo name="STD" value="66"/>
        <seriesInfo name="RFC" value="3986"/>
        <seriesInfo name="DOI" value="10.17487/RFC3986"/>
      </reference>
      <reference anchor="Template-TCPCONNECT">
        <front>
          <title>Template-Driven HTTP CONNECT Proxying for TCP</title>
          <author fullname="Benjamin M. Schwartz" initials="B. M." surname="Schwartz">
            <organization>Meta Platforms, Inc.</organization>
          </author>
          <date day="17" month="March" year="2025"/>
          <abstract>
            <t>   TCP proxying using HTTP CONNECT has long been part of the core HTTP
   specification.  However, this proxying functionality has several
   important deficiencies in modern HTTP environments.  This
   specification defines an alternative HTTP proxy service configuration
   for TCP connections.  This configuration is described by a URI
   Template, similar to the CONNECT-UDP and CONNECT-IP protocols.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-connect-tcp-07"/>
      </reference>
      <reference anchor="CONNECT-UDP">
        <front>
          <title>Proxying UDP in HTTP</title>
          <author fullname="D. Schinazi" initials="D." surname="Schinazi"/>
          <date month="August" year="2022"/>
          <abstract>
            <t>This document describes how to proxy UDP in HTTP, similar to how the HTTP CONNECT method allows proxying TCP in HTTP. More specifically, this document defines a protocol that allows an HTTP client to create a tunnel for UDP communications through an HTTP server that acts as a proxy.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9298"/>
        <seriesInfo name="DOI" value="10.17487/RFC9298"/>
      </reference>
    </references>
    <?line 491?>

<section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge.</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA+086XLbRpr/8RQdemsiOyQlyhofnGg8tETHqpIljSRnN7uz
lWkCTbHXIMAAoGRGUp4lz5In2+/objQIkKZje2trKq5UJAF9fP3dF7rT6QSF
LmLVF61zda2yXInXl5dn4uD05GR4cCnGaSYuD86ETCLx9vCsFYSyUFdptuiL
vIiCIErDRE5hepTJcdHJ0jydyneTtDOV+U9z1cl40U6YJokKi87OTpDPR1Od
5zpNisUMZh4NL18FyXw6Ulk/iGD5fgCjc5Xk87wvimyuguu+eBzITEkAsxXc
pNm7qyydz+CvN/O40LNYvVeRGMxmsQb4YGVxMR/lRQaLiRQAEH9/e3QghkmY
LWb4uhW8UwtYJuoHoiN+musQf06KYoY/Z1n6foG/GOCDa5XMASohPnVXIfjI
Lfx1KnUMvzKi/qZVMe6m2RW+kVk4gTcIT97f3saB+Ehfq64dto0PtkdZepOr
bV5iG6de6WIyH8HkhQRaxPIa/r/NtGmmCE6KAeK88Hb0Jnd5xa5O1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