<?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.6.26 (Ruby 3.0.2) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-damjanovic-websockets-https-rr-01" category="info" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.16.0 -->
  <front>
    <title abbrev="Advertising WebSockets support in HTTPSRR">Advertising the WebSockets support in the HTTPS resource record</title>
    <seriesInfo name="Internet-Draft" value="draft-damjanovic-websockets-https-rr-01"/>
    <author initials="D." surname="Damjanovic" fullname="Dragana Damjanovic">
      <organization>Microsoft</organization>
      <address>
        <email>dragana.damjano@gmail.com</email>
      </address>
    </author>
    <date year="2023" month="March" day="10"/>
    <area>ART</area>
    <workgroup>HTTP</workgroup>
    <keyword>Internet-Draft</keyword>
    <abstract>
      <t>This specification introduces a mechanism to advertise the support for WebSockets
over different HTTP versions using HTTPS resource records. This
mechanism allows clients to avoid delays in establishing WebSocket connections
using HTTP-based advertisement for WebSocket support.</t>
    </abstract>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>The mechanisms for running the WebSocket Protocol over a single stream of an
HTTP/2 and HTTP/3 connection are defined in <xref target="RFC8441"/> and <xref target="RFC9220"/>.
For bootstrapping WebSockets from HTTP/2 and HTTP/3 the extended CONNECT is used.
The support for the extended CONNECT is advertised using HTTP/2 and HTTP/3 settings
(see <xref target="RFC9113"/> and <xref target="RFC9114"/>). A client needs to establish an HTTP/2 or
HTTP/3 connection and wait for the setting frames to be exchanged to discover
whether it can try to use WebSockets over HTTP/2 or HTTP/3. The request still may
be rejected because the settings advertise the support for the extended CONNECT
but not explicitly the support for the WebSockets Protocol. The clients may choose
to attempt HTTP/2 or HTTP/3 first and fall back to HTTP/1.1 or HTTP/2 if the
WebSocket Protocol is not supported. This may add a delay. The other option is to
try to use WebSockets over HTTP/2 or HTTP/3 only on connections that are already
established and where it is known the extended CONNECT is supported. This approach
leads to WebSockets over HTTP/2 or HTTP/3 being used less frequently.</t>
      <t>This specification adds a way to advertise the support for WebSockets over HTTP
versions using HTTPS resource record <xref target="HTTPSRR"/>. The client may choose to try
using an HTTP/2 or HTTP/3 connection only if the support for the protocol is
advertised. This will eliminate the delay in most cases and increase usage of
WebSockets over HTTP/2 and HTTP/3.</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>
    </section>
    <section anchor="extending-https-dns-resource-record">
      <name>Extending HTTPS DNS resource record</name>
      <t>This specification introduces the "wss" SvcParamKey (see <xref target="HTTPSRR"/>) that
indicates a set of HTTP versions that support the WebSocket Protocol on the
particular service endpoint. The HTTP versions are identified using alpn-id
specified in <xref target="HTTPSRR"/>.</t>
      <t>The presentation value <bcp14>SHALL</bcp14> be a comma-separated list of one or more alpn-ids.
The wire format values for the "wss" SvcParamKey consists of at least one
alpn-id prefixed by its length as a single octet, and these length-value pairs
are concatenated to form the SvcParamValue. These pairs <bcp14>MUST</bcp14> exactly fill the
SvcParamValue; otherwise, the SvcParamValue is malformed.</t>
      <t>All alpn-ids listed in the "wss" <bcp14>MUST</bcp14> also be present in the "alpn" key.</t>
      <artwork><![CDATA[
example.net              IN HTTPS 1 . alpn=h2,h3 wss=h2,h3
]]></artwork>
    </section>
    <section anchor="the-client-behavior">
      <name>The Client Behavior</name>
      <t>Upon receiving an HTTPS RR, a client should use the "wss" SvcParamKey as an
indication of whether a particular service endpoint supports the WebSocket
Protocol over HTTP /2 or HTTP/3.</t>
      <t>If the key is present, that is a strong indication that the service endpoint
supports WebSockets over HTTP/2 or HTTP/3 protocol and the client can
attempt using WebSockets over HTTP/2 or HTTP/3 protocol. Due to difficulties
of deployments, the client may discover that the feature, although
advertised, is not supported and in this case, the client should fall back
to using HTTP/1.1.</t>
      <t>If the "no-default-alpn" key is present, the WebSocket Protocol over HTTP/1.1
is not supported by the endpoint. Otherwise, it might be supported whether
the "wss" key is present or not.</t>
      <t>If the "wss" key is not present, the client should not try using WebSockets over
HTTP/2 and HTTP/3, and should directly use HTTP/1.1.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This specification only adds a new SvcParamKey that is a hint of whether
the WebSockets over HTTP/2 and HTTP/3 are supported. Therefore, it does not
introduce additional security considerations beyond one described in
<xref target="HTTPSRR"/>, <xref target="RFC8441"/> and <xref target="RFC9220"/>.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <t>This specification adds the following entry to the Service Parameter Keys (SvcParamKeys) registry:</t>
      <table>
        <thead>
          <tr>
            <th align="left">Number</th>
            <th align="left">Name</th>
            <th align="left">Meaning</th>
            <th align="left">Format Reference</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td align="left">XX</td>
            <td align="left">wss</td>
            <td align="left">Support for WebSockets over HTTP/2 and HTTP/3</td>
            <td align="left">(This document) Section 3</td>
          </tr>
        </tbody>
      </table>
    </section>
  </middle>
  <back>
    <references>
      <name>Normative References</name>
      <reference anchor="HTTPSRR">
        <front>
          <title>Service binding and parameter specification via the DNS (DNS SVCB and HTTPS RRs)</title>
          <author fullname="Benjamin M. Schwartz" initials="B. M." surname="Schwartz">
            <organization>Google</organization>
          </author>
          <author fullname="Mike Bishop" initials="M." surname="Bishop">
            <organization>Akamai Technologies</organization>
          </author>
          <author fullname="Erik Nygren" initials="E." surname="Nygren">
            <organization>Akamai Technologies</organization>
          </author>
          <date day="11" month="October" year="2022"/>
          <abstract>
            <t>   This document specifies the "SVCB" and "HTTPS" DNS resource record
   (RR) types to facilitate the lookup of information needed to make
   connections to network services, such as for HTTP origins.  SVCB
   records allow a service to be provided from multiple alternative
   endpoints, each with associated parameters (such as transport
   protocol configuration and keys for encrypting the TLS ClientHello).
   They also enable aliasing of apex domains, which is not possible with
   CNAME.  The HTTPS RR is a variation of SVCB for use with HTTP [HTTP].
   By providing more information to the client before it attempts to
   establish a connection, these records offer potential benefits to
   both performance and privacy.

   TO BE REMOVED: This document is being collaborated on in Github at:
   https://github.com/MikeBishop/dns-alt-svc
   (https://github.com/MikeBishop/dns-alt-svc).  The most recent working
   version of the document, open issues, etc. should all be available
   there.  The authors (gratefully) accept pull requests.

            </t>
          </abstract>
        </front>
        <seriesInfo name="Internet-Draft" value="draft-ietf-dnsop-svcb-https-11"/>
      </reference>
      <reference anchor="RFC8441">
        <front>
          <title>Bootstrapping WebSockets with HTTP/2</title>
          <author fullname="P. McManus" initials="P." surname="McManus">
            <organization/>
          </author>
          <date month="September" year="2018"/>
          <abstract>
            <t>This document defines a mechanism for running the WebSocket Protocol (RFC 6455) over a single stream of an HTTP/2 connection.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="8441"/>
        <seriesInfo name="DOI" value="10.17487/RFC8441"/>
      </reference>
      <reference anchor="RFC9220">
        <front>
          <title>Bootstrapping WebSockets with HTTP/3</title>
          <author fullname="R. Hamilton" initials="R." surname="Hamilton">
            <organization/>
          </author>
          <date month="June" year="2022"/>
          <abstract>
            <t>The mechanism for running the WebSocket Protocol over a single stream of an HTTP/2 connection is equally applicable to HTTP/3, but the HTTP-version-specific details need to be specified. This document describes how the mechanism is adapted for HTTP/3.</t>
          </abstract>
        </front>
        <seriesInfo name="RFC" value="9220"/>
        <seriesInfo name="DOI" value="10.17487/RFC9220"/>
      </reference>
      <reference anchor="RFC9113">
        <front>
          <title>HTTP/2</title>
          <author fullname="M. Thomson" initials="M." role="editor" surname="Thomson">
            <organization/>
          </author>
          <author fullname="C. Benfield" initials="C." role="editor" surname="Benfield">
            <organization/>
          </author>
          <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="RFC9114">
        <front>
          <title>HTTP/3</title>
          <author fullname="M. Bishop" initials="M." role="editor" surname="Bishop">
            <organization/>
          </author>
          <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="RFC2119">
        <front>
          <title>Key words for use in RFCs to Indicate Requirement Levels</title>
          <author fullname="S. Bradner" initials="S." surname="Bradner">
            <organization/>
          </author>
          <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">
            <organization/>
          </author>
          <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>
    </references>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Y23LcuBF9x1cgkxc7Jc5qZFUlnmRTmZXksirWJZKc7NbW
1hZIgjNYkQQXAGc8sfQv+ZZ8WU4DvGpGllO1ehEFEt2N06dPNxRFEXPK5XLO
J4t0LY1TVpVL7laS/0vGtzq5l85yW1eVNo6r0r95f3d3fcuNtLo2icRDok06
YSKOjVw/sbTfirdwczNhqU5KUcB9akTmolQUv4hSr1USbWRsw8Zo5VxlI2Oi
wxlLhJNLbbZzmMk0Y6oyc+5Mbd3R4eHbwyMmjBRzvri5Yxtt7pdG19Xc+2P3
couldM7PSydNKV10Sk6ZdaJMfxa5LhHHVlpmC2Hcz7/W2kk756VmlZrzH51O
DrjFAYzMLJ62BT38xJio3UqbOeMR4/gJ54HppSgFP+1O5F9qg1X1b+GULuf8
QiVGW40Y6J0shMo9ErRz2mDxtyUtTxNdMFZqU2DrWsJZiyGOE51OA3xKuixK
S6uryK6TOAAHjIBUt5GxKIq4iK0zInGM3a0UUlPJRGUq8XEBWWd0WifScsEL
mawQsi2401w0mZWeB21CYX2QZ6bxDU9VlkkjS+fj5FiyMG157Vmxl0F2yikY
1nsUea43lie5giHrA1hrlfJU5mJriUgSyYtzZVcjrvFEl6VM6DCW9R6jWFiZ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