shelf
shelf copied to clipboard
Add support for http2
Now that we have https://github.com/dart-lang/http2
Given that http2 is its own package (and that it's marked experimental), it seems like it would be better for it to provide its own shelf adapter rather than baking one into shelf itself. Alternately, one could be made in its own shelf_http2 package.
I've made a proof of concept of a shelf adaptor which is available here: https://github.com/mkustermann/shelf/commit/80329c2ddbed1dfe0e7d8a2097c4fe9b241f5f48 This just exposes a new serveSecure method. An example can be found example/multiprotocol_server.dart. Feel free to try it out and provide feedback.
Just wondering if this is something that there is any interest in revisiting at all?
My particular use case is wanting to run a HTTP/2 service on Cloud Run which has a requirement to ensure that HTTP/2 is done without SSL using h2c (Relevant details here and here)
I’ve already confirmed that this works just using the standard http2 package but obviously don’t want to rebuild a worse version of Shelf on top of it.
I saw that the proof of concept posted in this thread made it seem like perhaps this wasn’t a major bit of work but didn’t want to sound too confident in that assumption at the same time.
The other major reason I’m interested in this is that it would really simplify some of the logic I have to write when it comes to handling headers since they are much more standardised in HTTP/2 along with the performance benefits it provides.
So it’s in that spirit I wanted to ask if this was a topic anyone is open to revisiting?