You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Alberto Schiabel, Nabil Redmann, Dannii Willis, omarinov, Marek Grzybek, Gábor Soós, Leonnardo Verol, Sachin Shekhar, Alex Yang, Wang Houlang and 3 more
We think about migration from express to koa in webpack-dev-server, it is only one blocker for us, can't find documentation how koa works with http2 and examples
Reacted by Guillaume Humbert, Layer, Philipp Kursawe, Kristijan Sedlak, Mario Valle, Vlad Balabash, Telokis, masx200, Martin Olsansky, Nicolas Coutin and 2 more
i've looked at this a long time ago, and adding push support was complicated and did not provide much benefit. koa would basically just set headers in the stream, but you'd still need to pipe data to the stream yourself.
this might be better as a framework using koa than supported in koa itself
Activity
likegun commentedon May 17, 2018
@budarin You can use
require('http2').createSecureServer(cert, new Koa().callback()).listen()to use http2 which answered by fl0w in this issuebudarin commentedon May 17, 2018
I am not about creating and starting the server - it is simple, I am about pushing resources, methods signatures and so
cupcakearmy commentedon May 30, 2018
While
is really neat and simple, I believe that something along the lines of
could be very helpful and really not a big addition in terms of codebase and complexity.
It's the same reason why we don't use
Any thoughts on the matter?
fl0w commentedon May 30, 2018
@cupcakearmy That proposal was turned down in #1063, I added a summary in this comment
budarin commentedon May 30, 2018
if I have to use callback syntax - then why do I need koa ???
fl0w commentedon May 30, 2018
@budarin Because that's the design of http. Koa's essentially just a "sugarized" requestListener.
budarin commentedon May 30, 2018
I am about somthing like a push method in express ...
Using http2 like a usual https - what is a profit?
fl0w commentedon May 30, 2018
@budarin Nobody said not to expand Koa support for HTTP/2, let's wait and see what happens.
budarin commentedon May 30, 2018
what year can we see it? :)
and one more question: will it be using compatibility API like it does at now or will use native HTTP/2 stream API?
alexander-akait commentedon Jul 30, 2019
We think about migration from
expresstokoainwebpack-dev-server, it is only one blocker for us, can't find documentation how koa works withhttp2and exampleswood1986 commentedon Aug 29, 2019
Hey @evilebottnawi, FYI I can get koa work with http2. This is the code that I am using
[-]http2 is out in node. [/-][+]http2 push support[/+][-]http2 push support[/-][+]http2 push stream support[/+][-]http2 push stream support[/-][+]http2 support[/+]jonathanong commentedon Apr 28, 2020
i've looked at this a long time ago, and adding push support was complicated and did not provide much benefit. koa would basically just set headers in the stream, but you'd still need to pipe data to the stream yourself.
this might be better as a framework using koa than supported in koa itself
let us know if you have any API recommendations
niftylettuce commentedon Aug 22, 2020
HTTP/2 already works with Koa.
See https://github.com/ladjs/web/blob/master/index.js for an example (note the lines are currently commented out because there is a core bug in Node with HTTP/2 XHR requests; they do not work). See https://www.theregister.com/2020/08/18/nodejs_chromium_patch/.
Ref: nodejs/node#33875 and <https://bugs.chromium.org/p/chromium/issues/detail?id=1045328#c46