<?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.17 (Ruby 3.1.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-momoka-httpbis-settings-enable-websockets-00" category="std" consensus="true" submissionType="IETF" updates="8441, 9220" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.15.3 -->
  <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-00"/>
    <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="January" day="07"/>
    <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 but not bootstrapping WebSockets over that HTTP connection.
In this case, the client sending a WebSocket handshake request will result in a response of 501 (Not Implemented) status code (Section 15.6.2 of <xref target="HTTP"/>),
and the client would need to fall back to trying the WebSocket handshake over HTTP/1.</t>
      <t>This is why a SETTINGS_ENABLE_WEBSOCKETS settings parameter is needed.</t>
    </section>
    <section anchor="settingsenablewebsockets-settigs-parameter-for-h2-and-h3">
      <name>SETTINGS_ENABLE_WEBSOCKETS settigs parameter for H2 and H3</name>
      <t>This document adds a new SETTINGS parameter to those defined by
<xref target="HTTP3"/> Section 11.2.2 and <xref target="HTTP2"/> Section 11.3.</t>
      <t>The new parameter name is SETTINGS_ENABLE_WEBSOCKETS.
The value of the parameter MUST be 0 or 1, with 0 being the default.</t>
      <t>A sender MUST NOT send a SETTINGS_ENABLE_WEBSOCKETS parameter
with the value of 0 after previously sending a value of 1.</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 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 would allow the client to determine in advance whether the server supports WebSockets over the connection for HTTP/2 or HTTP/3.
This allows the client to avoid sending unnecessary WebSocket handshake requests on HTTP connections that do not support WebSockets.</t>
      <t>This mechanism will improve compatibility with other extended CONNECT-based protocols.</t>
      <t>For compatibility with past implementations which do not use this parameter,
 clients MAY initiate a WebSocket request without the receipt of this parameter.</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="http3">
        <name>HTTP3</name>
        <t>This document registers a new entry in the "HTTP/3 Settings" registry (Section 11.2.2 of <xref target="HTTP3"/>).</t>
        <t>Value: TBD</t>
        <t>Setting Name: SETTINGS_ENABLE_WEBSOCKETS</t>
        <t>Default: 0</t>
        <t>Status: permanent</t>
        <t>Specification: This document</t>
        <t>Change Controller: IETF</t>
        <t>Contact: HTTP Working Group (ietf-http-wg@w3.org)</t>
      </section>
      <section anchor="http2">
        <name>HTTP2</name>
        <t>This document registers a new entry in the "HTTP/2 Settings" registry (Section 11.1 of <xref target="HTTP2"/>).</t>
        <t>Code: TBD</t>
        <t>Name: SETTINGS_ENABLE_ENABLE_WEBSOCKETS</t>
        <t>Default: 0</t>
        <t>Status: permanent</t>
        <t>Specification: This document</t>
        <t>Change Controller: IETF</t>
        <t>Contact: HTTP Working Group (ietf-http-wg@w3.org)</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="11" month="July" year="2022"/>
            <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-04"/>
        </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:
H4sIAAAAAAAAA81YzXLbRhK+4ykm8kWqEmD+yE6MqtRGoqSYjkW6RDiu1NaW
agA0yQmBGWRmQC6i0mmveYRc9r57yEOtn2O7B+CPSEqycooONonB9M/XX389
Q9/3PStsBiE7GF1EUX/w/ejmYnB69v7i5tPF2WjY++EiGjED1go5Mazgmudg
QbOx0uxtFH142WFcpvXH7oHH41jDPGQPG/NSlUg0ErJU87H1c5WrGfen1hax
MP7SlQ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