Internet-Draft | Advertising WebSockets support in HTTPSR | March 2023 |
Damjanovic | Expires 11 September 2023 | [Page] |
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.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 11 September 2023.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The mechanisms for running the WebSocket Protocol over a single stream of an HTTP/2 and HTTP/3 connection are defined in [RFC8441] and [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 [RFC9113] and [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.¶
This specification adds a way to advertise the support for WebSockets over HTTP versions using HTTPS resource record [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.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This specification introduces the "wss" SvcParamKey (see [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 [HTTPSRR].¶
The presentation value SHALL 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 MUST exactly fill the SvcParamValue; otherwise, the SvcParamValue is malformed.¶
All alpn-ids listed in the "wss" MUST also be present in the "alpn" key.¶
example.net IN HTTPS 1 . alpn=h2,h3 wss=h2,h3¶
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.¶
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.¶
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.¶
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.¶
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 [HTTPSRR], [RFC8441] and [RFC9220].¶
This specification adds the following entry to the Service Parameter Keys (SvcParamKeys) registry:¶
Number | Name | Meaning | Format Reference |
---|---|---|---|
XX | wss | Support for WebSockets over HTTP/2 and HTTP/3 | (This document) Section 3 |