http2 support tracker
there is not a direct thing we can do with ofetch to support http2 since ofetch depends on native runtime fetch as a wrapper but here are trackers:
- [ ] Node.js - undici (https://github.com/nodejs/undici/issues/2750)
- [ ] Bun (https://github.com/oven-sh/bun/issues/7194)
- [ ] Deno (already enabled?!) (https://github.com/unjs/ofetch/issues/420)
Do you have any idea how complicated would be to replace undici vs native fetch in ofetch ?
h2 support was added in undici at version 5.24.0 here: https://github.com/nodejs/undici/releases/tag/v5.24.0 We are now 6.19.3 if I'm not mistaken native fetch leverage undici behind
Your first checkbox Node.js - undici would definitely solve everything ofetch wise though without having to change anything.
We are already partially pre bundling undici (via node-fetch-native) for proxy support and in next major it is gonna be merged. Honestly i prefer to avoid doing this and wait for Node.js stable releases bundle a known stable version of undici (for proxy and h2 aupport) but lets see how long it takes.
@pi0 Fyi, the mentioned issue in NodeJS https://github.com/nodejs/undici/issues/2750 has been closed (it's no longer experimental but only used as default under certain conditions)