<?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.1.3) -->
<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902" docName="draft-momoka-httpbis-settings-enable-websockets-02" category="std" consensus="true" submissionType="IETF" updates="8441, 9220" tocInclude="true" sortRefs="true" symRefs="true" version="3">
  <!-- xml2rfc v2v3 conversion 3.17.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-02"/>
    <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="March" day="30"/>
    <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="settingsenablewebsockets-parameter">
      <name>SETTINGS_ENABLE_WEBSOCKETS Parameter</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.</t>
      <t>This parameter has no default value, as its absence indicates a lack of
information from the server.</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="settingsenableconnectprotocol-parameter">
      <name>SETTINGS_ENABLE_CONNECT_PROTOCOL Parameter</name>
      <t>A server which sends SETTINGS_ENABLE_WEBSOCKETS parameter MUST also send the
SETTINGS_ENABLE_CONNECT_PROTOCOL = 1.</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: None</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: None</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:
H4sIAAAAAAAAA61Zy5LbuBXd8yuQ9mZcJbGf8zAnTqbd3R634265WvK4pqam
uiASkhCRAAcApWhcXmWbT8gm+2QxHxV/R84FKOpB9cOp6YXdJoh7L84999wL
utvtRk66XCRsr38xGFxef9+/vbg+ffHm4vb9xYt+7+wvF4M+s8I5qcaWldzw
Qjhh2Egb9moweLt/xLjKwq/HexEfDo2YJexuY1GmUwUjCcsMH7luoQs95d2J
c+VQ2u7SVVcoPsxFdy6GVqdT4Wz34ChKuRNjbRYJsy6LqjLDv23Cvjk5Oeyw
Z0dHB1EkS5MwZyrrjg4OnmEPN4In7LQsc4ntUivrI74RPO8OZCGiuTbTsdFV
mfhjRFOxwKMsiRjrsvdi2A/+I1sNC2ktLAwWpaDly4vBy8g6mLvluVY400Lg
vYIbd/tLpX1sSkelTNhPTqcdZrVxRowsflsU9MvPUcQrN9EG5rqwyNioyvOA
z39/++3TP//NPv3r75/+8w+/xm0qYevKQ8Z+5AUvtNOrpZfN3l2vaDPmSv7q
MUjYYCLYOyVnwljpFkyP2EBPF3r//eX5BXtr9F9F6vw2UXCZJyzkKS4WX303
pidxqgu/nupKOUrJa15yFeFHaVPAy8xjRJAm/sUl0egJ68OscjK1e36NEpmw
o4Ojo+7BiX9ihZHCSjXSYTdjNy/PEvbs8PCg/vd57zJhhwfx4dcn33y9j9Vm
rYHU/3Trv+lHKqTkJmYvpcgz8GxtKQB3oxdssHMd8IF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