WebTransport (HTTP/3 over QUIC) as a transport for Phoenix sockets and LiveView, with one QUIC stream per LiveView component and shortest-message-first scheduling.
Add {PhoenixWebTransport, endpoint: MyAppWeb.Endpoint} (or
PhoenixWebTransport.Supervisor / PhoenixWebTransport.Quic.Listener) to
your supervision tree next to the endpoint:
- Pure-Erlang QUIC + HTTP/3 on
benoitc/erlang_quic(zero native builds) - Optional
socket_backend: :socketfor OTPsocketNIF (GRO/GSO on Linux)
Listeners register here (unless register: false), so pages and
PhoenixWebTransport.Plug can read url/0, port/0, and cert_hash/0.
Summary
Functions
Hex SHA-256 of the served dev cert for serverCertificateHashes, or nil.
Child specification delegating to PhoenixWebTransport.Supervisor.
Whether a WebTransport listener is running in this VM.
Returns QUIC path metrics (srtt, cwnd, congested, etc.) for a session.
The UDP port of the registered WebTransport listener, or nil.
Sends an opt-in RFC 9297 unreliable datagram (with automatic lane-0 fallback).
Returns runtime diagnostics for a live WebTransport session process.
Switches congestion control (:bbr | :cubic | :newreno) on a live session.
Sets an opt-in send deadline (timeout_ms) on a lane or slot.
Starts PhoenixWebTransport.Supervisor with the given options.
The URL pages should hand to LiveSocket, or nil when no listener runs.
Functions
@spec cert_hash() :: String.t() | nil
Hex SHA-256 of the served dev cert for serverCertificateHashes, or nil.
@spec child_spec(keyword()) :: Supervisor.child_spec()
Child specification delegating to PhoenixWebTransport.Supervisor.
@spec enabled?() :: boolean()
Whether a WebTransport listener is running in this VM.
@spec path_stats(GenServer.server()) :: {:ok, map()} | {:error, term()}
Returns QUIC path metrics (srtt, cwnd, congested, etc.) for a session.
@spec port() :: :inet.port_number() | nil
The UDP port of the registered WebTransport listener, or nil.
@spec send_datagram(GenServer.server(), iodata(), keyword()) :: :ok
Sends an opt-in RFC 9297 unreliable datagram (with automatic lane-0 fallback).
@spec session_info(GenServer.server()) :: {:ok, map()} | {:error, term()}
Returns runtime diagnostics for a live WebTransport session process.
@spec set_congestion_control(GenServer.server(), :bbr | :cubic | :newreno) :: :ok | {:error, term()}
Switches congestion control (:bbr | :cubic | :newreno) on a live session.
@spec set_stream_deadline( GenServer.server(), non_neg_integer(), pos_integer(), keyword() ) :: :ok | {:error, term()}
Sets an opt-in send deadline (timeout_ms) on a lane or slot.
@spec start_link(keyword()) :: Supervisor.on_start()
Starts PhoenixWebTransport.Supervisor with the given options.
@spec url() :: String.t() | nil
The URL pages should hand to LiveSocket, or nil when no listener runs.