hono icon indicating copy to clipboard operation
hono copied to clipboard

http2 support

Open KilianB opened this issue 1 year ago • 1 comments

What is the feature you are proposing?

With bun now implementing http2 server functionality https://github.com/oven-sh/bun/pull/14286 (releasing later during this week) what ramification does this have for hono? Is it possible to use them in conjunction or does this require architectural changes on the hono side?

KilianB avatar Oct 17 '24 06:10 KilianB

Hi @KilianB

Hmmm. node:http2, which is implemented on Bun now, is a Node.js API. The hono package in this repo does not support Node.js API. We may use the API with @hono/node-server, but performance may decrease than you think because this should convert Request/Response to Node.js's IncomingMessage/OutgoingMessage.

yusukebe avatar Oct 18 '24 08:10 yusukebe

Hi @KilianB

Hmmm. node:http2, which is implemented on Bun now, is a Node.js API. The hono package in this repo does not support Node.js API. We may use the API with @hono/node-server, but performance may decrease than you think because this should convert Request/Response to Node.js's IncomingMessage/OutgoingMessage.

I do need a way to get IncomingMessage/OutgoingMessage, could you export that function?

ianzone avatar Jan 26 '25 13:01 ianzone

Hi @ianzone

Are you using @hono/node-server? If so, you can retrieve Http2ServerRequest and Http2ServerResponse using the methods mentioned below.

https://github.com/honojs/node-server?tab=readme-ov-file#accessing-nodejs-api

usualoma avatar Jan 26 '25 21:01 usualoma