elysia icon indicating copy to clipboard operation
elysia copied to clipboard

Does this support http2 out of the box?

Open coolaj86 opened this issue 2 years ago • 10 comments

Does this enable http2 pipelining and such for streams and API requests?

I saw 0 issues when I searched for "http2", and nothing in the docs search about it.

coolaj86 avatar Dec 20 '23 22:12 coolaj86

@coolaj86, as far as I am aware, Bun supports http/2 client only at this time. You can, however, get streaming multiplexing when running your app behind a reverse proxy (Nginx), with http2 enabled.

go4cas avatar Dec 22 '23 05:12 go4cas

someone start http2-server implementation in Bun

https://github.com/oven-sh/bun/compare/main...ciro/http2-server

image

kravetsone avatar Jul 21 '24 11:07 kravetsone

As Elysia is using Bun.serve natively, the problems is blocking on Bun implementation of HTTP2 server.

If Bun support HTTP2 server, then Elysia would likely going to support HTTP2 server by the time Bun support it.

SaltyAom avatar Aug 30 '24 17:08 SaltyAom

Looks like HTTP2 support is coming in Bun v1.1.31: https://x.com/bunjavascript/status/1847014951661326396

image

crishoj avatar Oct 17 '24 21:10 crishoj

Looks like HTTP2 support is coming in Bun v1.1.31: https://x.com/bunjavascript/status/1847014951661326396

image

Yeah really. But this more about node:http2

How will Bun.serve work with it?

kravetsone avatar Oct 18 '24 08:10 kravetsone

Curious to hear what the Bun team says about HTTP2 support in Bun.serve: https://github.com/oven-sh/bun/issues/14672

crishoj avatar Oct 18 '24 20:10 crishoj

Please implement the HTTP/2 feature, as it is one of the most important components for API development.

kingrupam avatar Oct 19 '24 03:10 kingrupam

Workaround: implement your own adapter to use node:http2 -> https://gist.github.com/bogeychan/39290d2dcf468389c7b82dd8bdc7b2e0

bogeychan avatar Jan 31 '25 23:01 bogeychan

Any update on this as Bun now supports HTTP/2 servers with the 1.2 release?

import { createSecureServer } from "node:http2";

rogerxlk avatar Apr 11 '25 11:04 rogerxlk

Any update on this as Bun now supports HTTP/2 servers with the 1.2 release?

import { createSecureServer } from "node:http2";

Elysia uses Bun.serve so when Bun supports it Elysia will too

kravetsone avatar Apr 11 '25 18:04 kravetsone