<?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.39 (Ruby 3.4.9) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-rosomakho-masque-reverse-connect-01" category="std" consensus="true" submissionType="IETF" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.34.0 -->
  <front>
    <title>Reverse HTTP CONNECT for TCP and UDP</title>
    <seriesInfo name="Internet-Draft" value="draft-rosomakho-masque-reverse-connect-01"/>
    <author fullname="Yaroslav Rosomakho">
      <organization>Zscaler</organization>
      <address>
        <email>yrosomakho@zscaler.com</email>
      </address>
    </author>
    <date year="2026" month="June" day="21"/>
    <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="20" month="March" year="2026"/>
          <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-11"/>
      </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/8RQdemsiOyRlyhofnGg8tETHqpIljSRnN7uz
lWkCTbHXIMAAoGRGUp4lz5In2+/objQIkKZie2trKq5UJAF9fP3dF7rT6QSF
LmLVF60zdaWyXIk3FxenYv/k+Hi4fyHGaSYu9k+FTCLx7uC0FYSyUJdptuiL
vIiCIErDRE5hepTJcdHJ0jydyveTtDOV+U9z1cl40U6YJokKi87jXpDPR1Od
5zpNisUMZh4OL14HyXw6Ulk/iGD5fgCjc5Xk87wvimyugqu+eBLITEkAsxVc
p9n7yyydz+Cvt/O40LNYfVCRGMxmsQb4YGVxPh/lRQaLiRQAEH9/d7gvhkmY
LWb4uhW8VwtYJuoHoiN+musQf06KYoY/Z1n6YYG/GOCDK5XMASohPnVXIfjI
Lfx1KnUMvzKi/qZVMe6m2SW+kVk4gTcIT97f3saB+Ehfqa4dto0PtkdZep2r
bV5iG6de6mIyH8HkhQRaxPIK/r/NtGmmCE6KAeK88Hb0J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