<?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.24 (Ruby 3.1.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-momoka-httpbis-settings-enable-websockets-01" category="std" consensus="true" submissionType="IETF" updates="8441, 9220" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.16.0 -->
  <front>
    <title abbrev="SETTINGS_ENABLE_WEBSOCKETS">SETTINGS_ENABLE_WEBSOCKETS settings parameter for HTTP/2 and HTTP/3</title>
    <seriesInfo name="Internet-Draft" value="draft-momoka-httpbis-settings-enable-websockets-01"/>
    <author fullname="山本 桃歌" asciiFullname="Momoka Yamamoto">
      <organization ascii="Momoka Yamamoto">The University of Tokyo/WIDE Project</organization>
      <address>
        <postal>
          <country>Japan</country>
        </postal>
        <email>momoka.my6@gmail.com</email>
      </address>
    </author>
    <date year="2023" month="February" day="28"/>
    <area>Applications and Real-Time</area>
    <workgroup>HTTP</workgroup>
    <keyword>WebSockets</keyword>
    <abstract>
      <t>This document proposes a new HTTP settings parameter, SETTINGS_ENABLE_WEBSOCKETS.
This parameter indicates whether the server supports bootstrapping WebSockets over the established connection.</t>
    </abstract>
    <note removeInRFC="true">
      <name>Discussion Venues</name>
      <t>Discussion of this document takes place on the
    HTTP Working Group mailing list (ietf-http-wg@w3.org),
    which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>.</t>
      <t>Source for this draft and an issue tracker can be found at
    <eref target="https://github.com/momoka0122y/draft-settings-enable-websockets"/>.</t>
    </note>
  </front>
  <middle>
    <section anchor="introduction">
      <name>Introduction</name>
      <t>The mechanisms for running the WebSocket protocol <xref target="RFC6455"/> over a single stream of an HTTP/2 and HTTP/3 connection is defined in <xref target="RFC8441"/> and <xref target="RFC9220"/>.
The extended CONNECT mechanism is used for bootstrapping WebSockets from HTTP/2 and HTTP/3.
Support for the extended CONNECT mechanism is advertised using HTTP/2 and HTTP/3 settings parameter SETTINGS_ENABLE_CONNECT_PROTOCOL.</t>
      <t>However, the support of extended CONNECT does not necessarily indicate support for WebSockets over that HTTP connection.
Other protocols such as <xref target="WEBTRANSPORT"/> also use extended CONNECT and send SETTINGS_ENABLE_CONNECT_PROTOCOL settings parameters as well.</t>
      <t>Suppose the server supports Extended CONNECT and has a wss::// URL, but does not
support bootstrapping WebSockets over this HTTP connection.
In this case, a client attempting to initiate a WebSocket handshake using
Extended CONNECT will fail, and the client would need to create a WebSocket
connection using the HTTP/1.1 Upgrade mechanism.</t>
      <t>This is why a SETTINGS_ENABLE_WEBSOCKETS settings parameter is needed.</t>
    </section>
    <section anchor="the-settingsenablewebsockets-setting">
      <name>The SETTINGS_ENABLE_WEBSOCKETS Setting</name>
      <t>This document defines the SETTINGS_ENABLE_WEBSOCKETS parameter for HTTP/2 and HTTP/3.
A server can send this setting to inform a client that it supports bootstrapping WebSockets over the HTTP connection.</t>
      <t>The value of the parameter MUST be 0 or 1, with 0 being the default.</t>
      <t>If the server supports bootstrapping WebSockets over the HTTP connection,
it SHOULD include the SETTINGS_ENABLE_WEBSOCKETS parameter in the SETTINGS frame with a value of 1.
If the server does not support bootstrapping WebSockets over the HTTP connection it SHOULD send the parameter with a value of 0.</t>
      <t>A server MUST NOT send a SETTINGS_ENABLE_WEBSOCKETS parameter
with the value of 0 after previously sending a value of 1.</t>
      <t>A client MUST NOT send this setting parameter.
Receipt of this parameter by a server does not have any impact.</t>
      <t>The SETTINGS_ENABLE_WEBSOCKETS parameter is an explicit signal about the server
support for bootstrapping WebSockets on the connection. Where a server declares
it does not support WebSockets, clients can avoid sending WebSocket handshake
requests that would fail. This saves unnecessary work for both client and
server, and potentially reduces delays. For instance, a client that learns an
HTTP/2 or HTTP/3 connection does not support WebSockets via the setting, could
instead attempt to create a WebSocket using the HTTP/1.1 Upgrade mechanism at
the immediate moment it is required.</t>
      <t>Other protocols also rely on the extended CONNECT extension for bootstrapping.
This mechanism provides clients with a stronger signal about whether the
WebSocket protocol is supported on a connection. This can help improve
compatibility with other extended CONNECT-based protocols by avoiding the client
making assumption about the supported protocols.</t>
      <t>Clients that do not implement this extension will not be able to use its signal.
In order to support legacy deployments, clients MAY initiate a WebSocket request
when they receive SETTINGS_ENABLE_WEBSOCKETS with a value of 0, or if the
parameter is omitted from received settings. Such requests could fail,
introducing additional latency, which this extension is intended to help avoid.</t>
      <t>A server that sends SETTINGS_ENABLE_WEBSOCKETS with a value of 0 or omits the
parameter MUST NOT treat reception of the a WebSocket request as a stream or
connection error. Instead, the server can reject the request with a suitable
status code.</t>
    </section>
    <section anchor="security-considerations">
      <name>Security Considerations</name>
      <t>This document introduces no new security considerations beyond those discussed in <xref target="RFC8441"/>.</t>
    </section>
    <section anchor="iana-considerations">
      <name>IANA Considerations</name>
      <section anchor="http2-setting">
        <name>HTTP/2 Setting</name>
        <t>IANA is requested to register the following entry in the "HTTP/2 Settings"
registry maintained at &lt;<eref target="https://www.iana.org/assignments/http2-parameters"/>&gt;:</t>
        <t>Code: TBD</t>
        <t>Name: SETTINGS_ENABLE_WEBSOCKETS</t>
        <t>Initial Value: 0</t>
        <t>Specification: This document</t>
      </section>
      <section anchor="http3-setting">
        <name>HTTP/3 Setting</name>
        <t>IANA is requested to register the following entry in the "HTTP/3 Settings"
registry maintained at &lt;<eref target="https://www.iana.org/assignments/http3-parameters"/>&gt;:</t>
        <t>Value: TBD</t>
        <t>Setting Name: SETTINGS_ENABLE_WEBSOCKETS</t>
        <t>Default: 0</t>
        <t>Status: provisional</t>
        <t>Reference: This document</t>
        <t>Change Controller: Momoka Yamamoto (IETF if this document is approved)</t>
        <t>Contact: Momoka Yamamoto (HTTP_WG; HTTP working group; ietf-http-wg@w3.org if this document is approved)</t>
      </section>
    </section>
  </middle>
  <back>
    <displayreference target="HTTP2" to="HTTP/2"/>
    <displayreference target="HTTP3" to="HTTP/3"/>
    <references>
      <name>References</name>
      <references>
        <name>Normative References</name>
        <reference anchor="HTTP">
          <front>
            <title>HTTP Semantics</title>
            <author initials="R." surname="Fielding" fullname="Roy T. Fielding" role="editor">
              <organization>Adobe</organization>
            </author>
            <author initials="M." surname="Nottingham" fullname="Mark Nottingham" role="editor">
              <organization>Fastly</organization>
            </author>
            <author initials="J." surname="Reschke" fullname="Julian Reschke" role="editor">
              <organization>greenbytes</organization>
            </author>
            <date year="2022" month="April"/>
          </front>
          <seriesInfo name="RFC" value="9110"/>
          <seriesInfo name="DOI" value="10.17487/RFC9110"/>
        </reference>
        <reference anchor="HTTP2">
          <front>
            <title>HTTP/2</title>
            <author fullname="Martin Thomson" role="editor">
              <organization>Mozilla</organization>
            </author>
            <author fullname="Cory Benfield" role="editor">
              <organization>Apple Inc.</organization>
            </author>
            <date year="2022" month="April"/>
          </front>
          <seriesInfo name="RFC" value="9113"/>
          <seriesInfo name="DOI" value="10.17487/RFC9113"/>
        </reference>
        <reference anchor="HTTP3">
          <front>
            <title>Hypertext Transfer Protocol Version 3 (HTTP/3)</title>
            <author initials="M." surname="Bishop" fullname="Mike Bishop" role="editor">
              <organization>Akamai</organization>
            </author>
            <date year="2022" month="April"/>
          </front>
          <seriesInfo name="RFC" value="9114"/>
          <seriesInfo name="DOI" value="10.17487/RFC9114"/>
        </reference>
        <reference anchor="RFC6455">
          <front>
            <title>The WebSocket Protocol</title>
            <author fullname="I. Fette" initials="I." surname="Fette">
              <organization/>
            </author>
            <author fullname="A. Melnikov" initials="A." surname="Melnikov">
              <organization/>
            </author>
            <date month="December" year="2011"/>
            <abstract>
              <t>The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code.  The security model used for this is the origin-based security model commonly used by web browsers.  The protocol consists of an opening handshake followed by basic message framing, layered over TCP.  The goal of this technology is to provide a mechanism for browser-based applications that need two-way communication with servers that does not rely on opening multiple HTTP connections (e.g., using XMLHttpRequest or &lt;iframe&gt;s and long polling).  [STANDARDS-TRACK]</t>
            </abstract>
          </front>
          <seriesInfo name="RFC" value="6455"/>
          <seriesInfo name="DOI" value="10.17487/RFC6455"/>
        </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>
      </references>
      <references>
        <name>Informative References</name>
        <reference anchor="WEBTRANSPORT">
          <front>
            <title>The WebTransport Protocol Framework</title>
            <author fullname="Victor Vasiliev" initials="V." surname="Vasiliev">
              <organization>Google</organization>
            </author>
            <date day="24" month="January" year="2023"/>
            <abstract>
              <t>   The WebTransport Protocol Framework enables clients constrained by
   the Web security model to communicate with a remote server using a
   secure multiplexed transport.  It consists of a set of individual
   protocols that are safe to expose to untrusted applications, combined
   with a model that allows them to be used interchangeably.

   This document defines the overall requirements on the protocols used
   in WebTransport, as well as the common features of the protocols,
   support for some of which may be optional.

              </t>
            </abstract>
          </front>
          <seriesInfo name="Internet-Draft" value="draft-ietf-webtrans-overview-05"/>
        </reference>
      </references>
    </references>
    <section numbered="false" anchor="acknowledgments">
      <name>Acknowledgments</name>
      <t>TODO acknowledge people.</t>
      <t>Thank you for reading this draft. :)</t>
    </section>
  </back>
  <!-- ##markdown-source:
H4sIAAAAAAAAA61Yy3IbxxXdz1d0qI1VBQxBkH5oHCemSMqiIhIqArLK5XKx
GjMNoI2Z7nF3D2BYpVW2+YRssk8W/qjoO3Ju9+A5ICmmzIVETk/fx7nnvqbd
bkdOulwk7KB/MRhcXn/Xv724Pn3++uL23cXzfu/sbxeDPrPCOanGlpXc8EI4
YdhIG/ZyMHhz2GVcZeHX44OID4dGzBJ2t7Ao06mCkIRlho9cu9CFnvL2xLly
KG17qaotFB/moj0XQ6vTqXC23TmKUu7EWJtFwqzLoqrM8LdN2FcnJ0ct9qzb
7USRLE3CnKms63Y6zzrdiBvBE3ZalrnEdamV9RbfCJ63B7IQ0Vyb6djoqky8
G9FULPAoSyLG2uydGPaD/shWw0JaCwmDRSno+PJi8CKyDuJuea4VfFoIvFdw
425/qbS3TemolAn70em0xaw2zoiRxW+Lgn75KYp45SbaQFwbEhkbVXke8Pnv
779//Oe/2cd//f3jf/7hz7hNJWRdecjYD7zghXZ6ffRidXffK9qMuZK/eQwS
NpgI9lbJmTBWugXTIzbQ04U+fHd5fsHeGP2zSJ2/Jgou84SFOMXF4otvx/Qk
TnXhz1NdKUchecVLriL8KG0KaJl5jAjSxL+4JBo9YX2IVU6m9sCfUSAT1u10
u+3OiX9ihZHCSjXS4TZjNy/OEvbs6KhT/33eu0zYUSc++vLkqy8Pcbo6W0Hq
f9r1//QjFUJyE7MXUuQZeLZxFIC70Qs22HsO+ECjTA/FxkOjySWRSafNXequ
YnatPasnvGgovOJmuv/cK3zBrcsXj9T4Kga9bTqZioa6V1Uuudpz7LWNjRBq
uABx79JYR7QbwM2kLXO+SOpS0AjzYffx4T2+J7zHD4R3nTyAFYiC5bqwWu36
eaV/k3nOPx3WteAzlB/2XKgRMaRBD1QZwS5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