Skip to content

Conversation

@bneigher
Copy link

Summary

This PR adds WebTransport as an optional transport for Engine.IO connections, providing lower latency communication via HTTP/3 + QUIC.

Changes

  • Add wtransport dependency with optional webtransport feature
  • Create WebTransportTransport implementing AsyncTransport trait
  • Add WebTransport variants to AsyncTransportType enum
  • Add build_webtransport() and build_webtransport_with_upgrade() to ClientBuilder
  • Add WebTransport-specific error types

Why WebTransport?

WebTransport offers several advantages over WebSocket:

  • Lower latency via QUIC's 0-RTT connection establishment
  • Support for unreliable datagrams (useful for real-time audio/video)
  • Multiplexed streams without head-of-line blocking

Usage

// Enable the feature in Cargo.toml
// rust_engineio = { version = "0.6", features = ["webtransport"] }

let client = ClientBuilder::new(url)
    .build_webtransport()
    .await?;

// Or upgrade from polling if server advertises WebTransport support
let client = ClientBuilder::new(url)
    .build_webtransport_with_upgrade()
    .await?;

// Datagram support for unreliable low-latency data
client.transport().send_datagram(&audio_frame).await?;

Test plan

  • Builds successfully with cargo build -p rust_engineio --features webtransport
  • Builds without feature flag (no breaking changes)
  • Integration tests with WebTransport server (tests marked #[ignore] - require server)

Add WebTransport as an optional transport for Engine.IO connections,
providing lower latency communication via HTTP/3 + QUIC.

- Add wtransport dependency with optional webtransport feature
- Create WebTransportTransport implementing AsyncTransport trait
- Add WebTransport variants to AsyncTransportType enum
- Add build_webtransport() and build_webtransport_with_upgrade() to ClientBuilder
- Add WebTransport-specific error types

WebTransport offers several advantages over WebSocket:
- Lower latency via QUIC's 0-RTT connection establishment
- Support for unreliable datagrams (useful for audio/video)
- Multiplexed streams without head-of-line blocking

Usage:
```rust
let client = ClientBuilder::new(url)
    .build_webtransport()
    .await?;
```
@bneigher bneigher force-pushed the feature/webtransport-transport branch from 65c2b4f to 12a9308 Compare January 14, 2026 07:21
@bneigher bneigher changed the title feat(engineio): add WebTransport transport support DRAFT: feat(engineio): add WebTransport transport support Jan 14, 2026
@bneigher bneigher marked this pull request as draft January 14, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant