WebTransport: closed property

Baseline 2026
Newly available

Since March 2026, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Note: This feature is available in Web Workers.

The closed read-only property of the WebTransport interface returns a promise that resolves when the transport is closed.

This promise is created when the WebTransport object is created and is resolved when the transport is closed in any way, such as by calling the close() method, when the connection failed, or when the connection is closed by the server. Accessing or awaiting this promise does not trigger any action; it only allows actions to be taken when the transport is closed, similar to listening to an event.

Value

A Promise that resolves to an object containing the following properties:

closeCode

A number representing the error code for the error.

reason

A string representing the reason for closing the WebTransport.

Or, in the case of an unexpected closure, such as network failure, the promise rejects with an error.

Examples

js
const url = "https://example.com:4999/wt";

async function initTransport(url) {
  // Initialize transport connection
  const transport = new WebTransport(url);

  // The connection can be used once ready fulfills
  await transport.ready;

  // …
}

// …

async function closeTransport(transport) {
  // Respond to connection closing
  try {
    await transport.closed;
    console.log(`The HTTP/3 connection to ${url} closed gracefully.`);
  } catch (error) {
    console.error(`The HTTP/3 connection to ${url} closed due to ${error}.`);
  }
}

Specifications

Specification
WebTransport
# dom-webtransport-closed

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
closed
Chrome – Full support
Chrome 97 (Release date: 2022-01-04)
footnote Full support
Edge – Full support
Edge 97 (Release date: 2022-01-06)
footnote Full support
Firefox – Full support
Firefox 114 (Release date: 2023-06-06)
footnote Full support
Opera – Full support
Opera 83 (Release date: 2022-01-19)
footnote Full support
Safari – Full support
Safari 26.4 (Release date: 2026-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 97 (Release date: 2022-01-04)
footnote Full support
Firefox for Android – Full support
Firefox for Android 114 (Release date: 2023-06-06)
footnote Full support
Opera Android – Full support
Opera Android 68 (Release date: 2022-03-30)
footnote Full support
Safari on iOS – Full support
Safari on iOS 26.4 (Release date: 2026-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 18 (Release date: 2022-08-08)
footnote Full support
WebView Android – Full support
WebView Android 97 (Release date: 2022-01-04)
footnote Full support
WebView on iOS – Full support
WebView on iOS 26.4 (Release date: 2026-03-24)
footnote Full support
Deno – No support
Deno 2.2 (Release date: 2025-02-19)
disabled
disabled From version 2.2 users must explicitly set the --unstable-net runtime flag.

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
User must explicitly enable this feature.

See also