Skip to content

v2.3.0

Choose a tag to compare

@dancixx dancixx released this 30 Sep 11:39
· 9 commits to main since this release
c2381a1

Tako 2.3.0 serves W3C WebTransport sessions that browsers can connect to, makes streaming gRPC a stable API, and runs every transport on both Tokio and Compio. It also fixes unary gRPC replies for grpc-go based clients such as grpcurl, and removes the outbound HTTP client.

This release includes breaking changes. Read the 2.3 migration guide before upgrading from 2.2.x. All eight workspace crates are versioned together at 2.3.0 and require Rust 1.95 or newer.

Breaking changes and migration

  • tako::client (TakoClient, TakoTlsClient, V2Client) and the client and native-certs features were removed. Use reqwest or ureq for outbound HTTP.
  • The webtransport feature now enables http3, and with it QUIC datagrams are always on: ServerConfig::h3_enable_datagrams = false no longer disables them.
  • GrpcServerStream has a new public deadline field. Struct literals need deadline: None; GrpcServerStream::new is unaffected.

Added

  • W3C WebTransport on the HTTP/3 server, on Tokio and Compio. A CONNECT route takes the WebTransport extractor and returns on_session, so the router and its middleware see the request before the session starts. WebTransportSession offers bidirectional and unidirectional streams, datagrams, close(code, reason), and closed(). The session driver watches the CONNECT stream, so a browser's transport.close() reaches the server within milliseconds instead of at the QUIC idle timeout. Tested against Chrome and the wtransport client. RawQuicSession stays as a Tokio-only raw QUIC helper.
  • Stable streaming gRPC: server streaming with GrpcServerStream, client streaming with GrpcClientStream, and bidirectional streaming with GrpcBidi::respond. Option<GrpcDeadline> extracts the client's grpc-timeout and with_deadline enforces it; From<GrpcError> for GrpcStatus lets handlers use ?, and GrpcStatus is a responder for trailers-only errors. Every RPC shape is tested against a tonic client on both runtimes.
  • Every transport on Compio: h2c, Unix sockets, PROXY protocol v1/v2, HTTP/3 (over compio-quic), and WebTransport, through CompioServer::try_spawn_h2c, try_spawn_unix_http, try_spawn_proxy_protocol, and try_spawn_h3.
  • Examples: examples/webtransport (a browser demo using serverCertificateHashes, no certificate to install), examples/grpc-streaming, and examples/raw-quic (the previous WebTransport example).

Fixed and improved

  • Unary gRPC replies send grpc-status in the HTTP/2 trailers. Before, grpc-go based clients failed with server closed the stream without sending trailers.
  • GrpcRequest reads only as far as the first message and rejects messages over MAX_GRPC_MESSAGE_SIZE before buffering them, instead of collecting the whole request body.
  • A GrpcServerStream ends at its first Err, and later items are no longer sent after the status trailers. Messages that are ready together share DATA frames of up to 32 KiB, which also keeps recent h2 clients from closing the connection over too many small frames.
  • The gRPC request decoder reports a truncated message once and stops after the first error instead of repeating it.
  • build_rustls_server_config installs aws-lc-rs as the process-wide rustls provider when none is installed, so builds that compile both ring and aws-lc-rs, such as with http3, no longer panic at startup.
  • #[tako::route] expansions no longer trigger unreachable_code warnings for path parameters whose parse error is uninhabited, such as String.
  • Documentation: llms.txt and llms-full.txt, a Markdown version of every page, a comparison with Axum and Actix Web, a Coming from Axum guide, and guides for WebTransport and streaming gRPC.

Full diff: v2.2.0...v2.3.0