feat!: enable h2 by default by metcoder95 · Pull Request #4828 · nodejs/undici (original) (raw)

This relates to...

This enables HTTP/2 support by default in Undici.

Rationale

Currently, users must explicitly opt-in to H2 support via allowH2: true. This change adjusts Undici's defaults to align with current web standards and improve out-of-the-box performance.

Changes

This PR changes the default value of the allowH2 option from false to true in the connection builder (lib/core/connect.js). When connecting to HTTPS servers, Undici will now use HTTP/2 if the server advertises it through ALPN negotiation, falling back to HTTP/1.1 if not supported.

Features

Bug Fixes

N/A

Breaking Changes and Deprecations

Breaking Change: The default value of allowH2 changes from false to true.

Impact:

Status