Repository navigation
feat: make HTTP/3 opt-in in the Rust crate - #595
Draft
metalwarrior665 wants to merge 1 commit into
Draft
metalwarrior665 wants to merge 1 commit into
metalwarrior665 wants to merge 1 commit into
Conversation
reqwest's `http3` feature makes every client set up a QUIC endpoint (a UDP socket, a driver task and a receive buffer of at least 2 MB), even when HTTP/3 is never used. HTTP/3 support is now behind the `http3` feature of the `impit` crate, so clients without it skip that setup, and the crate builds without `--cfg reqwest_unstable`. The Node and Python bindings enable the feature, so their `http3` option works as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S
metalwarrior665
force-pushed
the
feat/http3-opt-in
branch
from
October 23, 2026 20:21
43f8b4c to
09b456d
Compare
There was a problem hiding this comment.
🟢 Approval recommended
The feature gates, binding configuration, documentation, and CI changes are consistent, with no blocking issues identified.
No open issues 🎉
What changed in this PR
Makes HTTP/3 opt-in for the Rust crate, avoiding unnecessary QUIC setup for default clients while preserving HTTP/3 support in the Node.js and Python bindings.
Changes:
- Adds an
http3Cargo feature and gates HTTP/3-specific code and dependencies. - Updates examples and documentation to reflect the new opt-in requirement.
- Adds feature-enabled CI tests and includes HTTP/3 APIs in generated documentation.
| File | Description |
|---|---|
| README.md | Documents HTTP/3 opt-in and simplifies the example. |
| impit/src/lib.rs | Gates the HTTP/3 module and updates crate documentation. |
| impit/src/impit.rs | Gates HTTP/3 functionality and tests default-disabled behavior. |
| impit/README.md | Updates feature requirements and the example. |
| impit/examples/basic.rs | Removes HTTP/3 from the default example. |
| impit/Cargo.toml | Defines the feature and makes supporting dependencies optional. |
| impit-python/Cargo.toml | Enables HTTP/3 for Python bindings. |
| impit-node/Cargo.toml | Enables HTTP/3 for Node.js bindings. |
| .github/workflows/format.yaml | Adds tests with HTTP/3 enabled. |
| .github/workflows/docs.yaml | Builds documentation with HTTP/3 enabled. |
Review effort: Balanced
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
reqwest's
http3feature makes every client that usesuse_preconfigured_tlsbuild an HTTP/3 connector, even when HTTP/3 is never used. That means a quinn endpoint per client: a UDP socket, a driver task, and a zeroed receive buffer of at least 2 MB.In a CPU profile of a Rust Instagram scraper that builds one impit client per proxy session, this endpoint setup took ~6% of all CPU, for a protocol it never uses.
HTTP/3 support is now behind a new
http3feature of theimpitcrate:hickory-*andtokioaren't needed.--cfg reqwest_unstable.impit-nodeandimpit-pythonenable the feature, so theirhttp3option behaves as before.with_http3()now needsfeatures = ["http3"]. It's removed from the README and doc examples.CI now also runs
cargo test -p impit --features http3, and the docs are built with the feature on.The proxy fix that used to be part of this PR is now #598. Whichever of the two lands second needs
#[cfg(feature = "http3")]on #598's test, which callswith_http3().🤖 Generated with Claude Code
https://claude.ai/code/session_0148RYR4BTGyCYHENSRZjC3S