'Is WebSocket compatible with HTTP/3

The upcoming HTTP/3 standard is no longer based on TCP, but on the QUIC protocol. WebSocket is based on TCP and is initiated as HTTP update.

Is a WebSocket connection initiated as HTTP/3 update based on QUIC instead of TCP? Or is it not possible to update a HTTP/3 connection to a WebSocket connection?



Solution 1:[1]

Since this is the top search result for "http3 websockets", I want to keep the answers up-to-date.

As of December 2021, there is now an IETF draft that amends RFC8441 (Bootstrapping WebSockets with HTTP/2) with the adjustments necessary for HTTP/3. If the draft is accepted, there will be a standardized way for WebSockets to be initiated over HTTP/3.

The draft is on its second revision and will expire in July 2022 if there are no further revisions and it is not accepted by that time.

Solution 2:[2]

Currently only HTTP/1.1 is supported by the RFC6455 to be used for connection upgrade.

Once a connection to the server has been established (including a
connection via a proxy or over a TLS-encrypted tunnel), the client
MUST send an opening handshake to the server. The handshake consists of an HTTP Upgrade request, along with a list of required and
optional header fields. The requirements for this handshake are as
follows.

  1. The handshake MUST be a valid HTTP request as specified by [RFC2616].

  2. The method of the request MUST be GET, and the HTTP version MUST be at least 1.1.

However, there are proposals to support HTTP/2 as well as HTTP/3 (as Remy Lebeau mentioned in comment above).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 David L Kinney
Solution 2 Community