Bootstrapping WebSockets with HTTP/2
RFC 8441
Document | Type |
RFC - Proposed Standard
(September 2018; Errata)
Updates RFC 6455
|
|
---|---|---|---|
Author | Patrick McManus | ||
Last updated | 2018-09-21 | ||
Replaces | draft-mcmanus-httpbis-h2-websockets | ||
Stream | IETF | ||
Formats | plain text html pdf htmlized bibtex | ||
Reviews | |||
Stream | WG state | Submitted to IESG for Publication | |
Document shepherd | Mark Nottingham | ||
Shepherd write-up | Show (last changed 2018-05-07) | ||
IESG | IESG state | RFC 8441 (Proposed Standard) | |
Consensus Boilerplate | Yes | ||
Telechat date | |||
Responsible AD | Alexey Melnikov | ||
Send notices to | Mark Nottingham <mnot@mnot.net> | ||
IANA | IANA review state | IANA OK - Actions Needed | |
IANA action state | RFC-Ed-Ack |
Internet Engineering Task Force (IETF) P. McManus Request for Comments: 8441 Mozilla Updates: 6455 September 2018 Category: Standards Track ISSN: 2070-1721 Bootstrapping WebSockets with HTTP/2 Abstract This document defines a mechanism for running the WebSocket Protocol (RFC 6455) over a single stream of an HTTP/2 connection. Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8441. Copyright Notice Copyright (c) 2018 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. McManus Standards Track [Page 1] RFC 8441 H2 WebSockets September 2018 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. The SETTINGS_ENABLE_CONNECT_PROTOCOL SETTINGS Parameter . . . 3 4. The Extended CONNECT Method . . . . . . . . . . . . . . . . . 4 5. Using Extended CONNECT to Bootstrap the WebSocket Protocol . 4 5.1. Example . . . . . . . . . . . . . . . . . . . . . . . . . 6 6. Design Considerations . . . . . . . . . . . . . . . . . . . . 6 7. About Intermediaries . . . . . . . . . . . . . . . . . . . . 6 8. Security Considerations . . . . . . . . . . . . . . . . . . . 7 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 9.1. A New HTTP/2 Setting . . . . . . . . . . . . . . . . . . 7 9.2. A New HTTP Upgrade Token . . . . . . . . . . . . . . . . 7 10. Normative References . . . . . . . . . . . . . . . . . . . . 8 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 8 1. Introduction The Hypertext Transfer Protocol (HTTP) [RFC7230] provides compatible resource-level semantics across different versions, but it does not offer compatibility at the connection-management level. Other protocols that rely on connection-management details of HTTP, such as WebSockets, must be updated for new versions of HTTP. The WebSocket Protocol [RFC6455] uses the HTTP/1.1 Upgrade mechanism (Section 6.7 of [RFC7230]) to transition a TCP connection from HTTP into a WebSocket connection. A different approach must be taken with HTTP/2 [RFC7540]. Due to its multiplexing nature, HTTP/2 does not allow connection-wide header fields or status codes, such as the Upgrade and Connection request-header fields or the 101 (Switching Protocols) response code. These are all required by the [RFC6455] opening handshake. Being able to bootstrap WebSockets from HTTP/2 allows one TCP connection to be shared by both protocols and extends HTTP/2's more efficient use of the network to WebSockets. This document extends the HTTP CONNECT method, as specified for HTTP/2 in Section 8.3 of [RFC7540]. The extension allows the substitution of a new protocol name to connect to rather than the external host normally used by CONNECT. The result is a tunnel on a single HTTP/2 stream that can carry data for WebSockets (or any other protocol). The other streams on the connection may carry more extended CONNECT tunnels, traditional HTTP/2 data, or a mixture of both. McManus Standards Track [Page 2] RFC 8441 H2 WebSockets September 2018 This tunneled stream will be multiplexed with other regular streams on the connection and enjoys the normal priority, cancellation, and flow-control features of HTTP/2. Streams that successfully establish a WebSocket connection using a tunneled stream and the modifications to the opening handshakeShow full document text