Skip to content
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

[Question] Does it support HTTP/2 ? (compraison with Got) #620

Closed
SirMishaa opened this issue Aug 15, 2024 · 2 comments
Closed

[Question] Does it support HTTP/2 ? (compraison with Got) #620

SirMishaa opened this issue Aug 15, 2024 · 2 comments

Comments

@SirMishaa
Copy link

Hello,

Coming from the got repository page, I saw the following :
image

Is this still up to date ? HTTP/2 is pretty useful in terms of speed, so I wanted to know if KY support it before considering it for work.
I didn't find the answer, so sorry if it explained somewhere.

@sindresorhus
Copy link
Owner

Ky is based on fetch, and I believe fetch uses HTTP/2 in browsers. For Node.js, see: nodejs/undici#2750

@sholladay
Copy link
Collaborator

Ky supports HTTP/2 and even HTTP/3. The environment just has to support it.

Here is a Ky request to an HTTP/3 server in Firefox.

import ky from 'https://esm.sh/ky@1';

const page = await ky('/').text();
console.log(page);
image

For browsers, the support is pretty good.

HTTP/2: https://caniuse.com/http2
HTTP/3: https://caniuse.com/http3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants