-
Notifications
You must be signed in to change notification settings - Fork 18
feat: http/2 listener support #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SukkaW
wants to merge
16
commits into
unjs:main
Choose a base branch
from
SukkaW:http2-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
6e3d337
refactor: simplify code
SukkaW 3d54aaf
feat: handle connection header
SukkaW fe5c360
feat: ignore conflicting http/2 pseudo headers
SukkaW 29bb3a0
feat: ignore statusMessage on HTTP/2
SukkaW 4f85058
feat: implement HTTP/2 listener
SukkaW 4e514df
refactor: proper determine connection is encrypted
SukkaW 811a25d
refactor: handle `:authority` and `transfer-encoding`
SukkaW 45d3a02
test: add http2 listener test
SukkaW 9a92849
refactor: types and test
SukkaW 9d401ac
test: update test to re-use util
SukkaW 84d4c02
test: improve coverage
SukkaW 68a2f02
chore: add comment
SukkaW ebfd52d
test: fix describe
SukkaW 795359d
test: extract util
SukkaW 50c9d9e
fix: ws listen upgrade
SukkaW 91b63fb
test: fix coverage
SukkaW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: unjs/httpxy
Length of output: 386
🏁 Script executed:
Repository: unjs/httpxy
Length of output: 282
🌐 Web query:
undici HTTP/2 support Node.js💡 Result:
Undici (and therefore Node.js’s built-in
fetch) is primarily an HTTP/1.1 client, but it does have HTTP/2 client support as an experimental, opt-in feature. [1] [2]How to use HTTP/2 with undici
Enable it by using an
Agent/ClientwithallowH2: true(HTTP/2 is negotiated via ALPN). The docs also note constraints like “TLS-only” and “h2c is not supported” (so in practice you typically needhttps://+ a server that negotiatesh2). [2]Node.js built-in
fetchand HTTP/2Node’s built-in
fetch()uses the undici version bundled with your Node release, and HTTP/2 is not enabled by default—there’s an open request to support HTTP/2 by default in fetch. [3] [4]Sources: [1] undici repo README, [2] undici
ClientAPI docs (UNPKG) incl.allowH2+ HTTP/2 notes, [3] undici discussion mentioning enabling H2 viaallowH2: truefor fetch, [4] undici issue requesting HTTP/2-by-default for fetch.LGTM - undici is suitable for HTTP/2 testing with proper configuration.
The
undici7.21.0 package is stable and has no known security vulnerabilities. However, HTTP/2 support is an experimental, opt-in feature that requires explicit configuration (allowH2: trueon the Agent/Client). As a devDependency, it won't affect production bundles. Note that version 7.22.0 is available if you want to stay current with the latest patch.🤖 Prompt for AI Agents