5 releases

0.2.0 Nov 14, 2025
0.1.4 Nov 14, 2025
0.1.3 Oct 25, 2025
0.1.1 Sep 4, 2025

#11 in #polyfill

Download history 304/week @ 2025-09-02 37/week @ 2025-09-09 39/week @ 2025-09-16 47/week @ 2025-09-23 81/week @ 2025-09-30 56/week @ 2025-10-07 183/week @ 2025-10-14 235/week @ 2025-10-21 64/week @ 2025-10-28 46/week @ 2025-11-04 54/week @ 2025-11-11 29/week @ 2025-11-18 32/week @ 2025-11-25 35/week @ 2025-12-02

153 downloads per month
Used in moq-relay

MIT/Apache

145KB
3.5K SLoC

Rust 2.5K SLoC // 0.1% comments TypeScript 686 SLoC // 0.0% comments

WebTransport Polyfill

A WebTransport polyfill that uses WebSocket as the underlying transport, with implementations in both Rust and TypeScript/JavaScript.

Wire Protocol

Both implementations use the same QUIC-like frame encoding over WebSocket:

  • Variable-length integer encoding (VarInt)
  • Stream multiplexing with bidirectional and unidirectional streams
  • Frame types: STREAM, RESET_STREAM, STOP_SENDING, etc.

This is a simplified version of QMux, which might be used in the future.

JavaScript/TypeScript Usage

Check if WebTransport is available, otherwise install the polyfill:

import { install } from "@kixelated/web-transport-ws"

// Install the polyfill if needed.
install();

// Now WebTransport is available even in Safari
const transport = new WebTransport("https://example.com/path")

URLs are automatically rewritten with the WebSocket protocol:

  • https://example.com/pathwss://example.com/path

Building

Rust

cargo build

TypeScript/JavaScript

npm install
npm run build

License

MIT OR Apache-2.0

Dependencies

~6–11MB
~185K SLoC