W3cubDocs

/Web APIs

WebTransport: reliability property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The reliability read-only property of the WebTransport interface indicates whether the connection supports reliable transports only, or whether it also supports unreliable transports (such as UDP).

Note: This feature is available in Web Workers

Value

A string with one of the following values:

pending

The connection has not yet been established. The reliability is not yet known.

reliable-only

The connection only supports reliable transports.

supports-unreliable

The connection supports both unreliable and reliable transports.

Examples

js

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

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

  // Once ready fulfils the connection can be used
  // Prior to this the reliability is "pending"
  await transport.ready;

  if (transport.reliability == "reliable-only") {
    // Use connection only with reliable transports
  } else {
    // Use connection with either reliable or unreliable transports.
  }
  // ...
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
reliability No No 114 No No No No No 114 No No No

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WebTransport/reliability