Skip to content

PyWebTransport

An async-native WebTransport stack for Python


Overview

PyWebTransport implements the WebTransport protocol over QUIC and HTTP/3. It provides a deterministic state machine for streams and datagrams, alongside a high-level application framework designed for standards compliance and strict concurrency safety.

Features

  • Sans-I/O Architecture: Powered by an ownership-driven Rust state machine decoupled from an autonomous threaded reactor via a lock-free IPC boundary.
  • Transport Primitives: Full implementation of bidirectional streams, unidirectional streams, and unreliable datagrams.
  • Structured Concurrency: Deterministic lifecycle management for connections and streams via asynchronous context managers.
  • Zero-Copy I/O: End-to-end support for buffer protocols and memoryview to minimize data copying overhead.
  • Application Framework: Declarative ServerApp featuring path-based routing and composable stateful middleware.

Interoperability

Infrastructure

Endpoints

  • /echo: Bidirectional stream and datagram reflection.
  • /stats: Current session statistics and negotiated parameters.
  • /status: Global server health and aggregate metrics.
  • /webtransport/devious-baton: Devious Baton protocol state transition validation.

API Reference

  • Full Reference: Comprehensive documentation organized into the Application Framework, Transport Layer, and Shared Primitives.

Community

  • GitHub: Source code and issue tracker.
  • PyPI: Package distribution.

License

Distributed under the terms of the Apache License 2.0. See LICENSE for details.