6

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?

Daniel Stenberg
  • 44,219
  • 12
  • 115
  • 175
Benjamin Buch
  • 2,066
  • 12
  • 25
  • 1
    The current WebSocket protocol requires TCP, though there is nothing stopping *implementations* from including support for QUIC at the transport layer. There are proposals to adapt the WebSocket protocol to QUIC/HTTP3, though. – Remy Lebeau Aug 06 '19 at 18:36
  • 3
    I think a new approach is taking over: a replacement for WebSockets and WebRTC that supports both Reliable streams and Unreliable datagrams optionally via quic: https://wicg.github.io/web-transport/ For now I think you're best off using SSE (EventSource) for QUIC based server sent events – Thomas Grainger Jun 28 '20 at 16:24

1 Answers1

3

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).

Sergey Kamardin
  • 1,518
  • 1
  • 16
  • 21