-
Notifications
You must be signed in to change notification settings - Fork 27
HTTP/2 support in Core #6
Comments
First of all - thank you. This sounds like a huge undertaking, I think it would be great if you build it in a way that others can work on it simultaneously and review the code. I think making a "shabang" pull request of the whole thing could be really risky where a more iterative model would be nicer. |
@benjamingr ... all work I do here will be done openly and I would gladly accept help from any and all :-) |
Btw, fwiw, the most likely path that I'll be exploring first on this will be to integrate nghttp2 (https://nghttp2.org/documentation/index.html) into Node.js (https://nghttp2.org, https://github.com/nghttp2/nghttp2, https://github.com/nghttp2/nghttp2/blob/master/COPYING). It is written in C, uses a callback model, does not insist on doing it's own I/O (so it can be integrated with libuv easily), and is MIT licensed. It is also one of the most compliant library implementations available. |
I'm curious what the API would like but I'm less convinced that that should be in core than I used to be, simply because it will be a massive overhead on an already difficult to maintain core module. The HTTP module should probably be re-written before/alongside of this to keep it from being a huge future disaster... |
How do you figure the overhead would be "massive" or the implementation a The API can be quite similar but the internals would share very little I'm curious what the API would like but I'm less convinced that that should The HTTP module should probably be re-written before/alongside of this to — |
We should just use it. It is:
I guess we may even have a common C interface for both HTTP/1.1 and HTTP/2.0! |
Quick update on what I've been able to get done this week on this... I elected to start with the excellent and very well tested nghttp2 library to provide the bulk of the http/2 implementation details. This library provides a straightforward C API for handling all of the http/2 details. The library does not do it's own I/O which is a good thing. I have the start of a In a new internal module ( I am in the process of implementing While I have only just scratched the surface of the implementation, I do have the following simple test case working using both chrome and nghttp2's own command line client:
As you can see, the basic API is essentially identical. Once I'm a bit further along in the prototype implementation, I will be opening a node-eps that proposes adding the nghttp2 implementation behind a compile-time flag, with the implementation being marked as experimental in v7. So far, the implementation is actually quite a bit simpler than the existing The current implementation work is quite rough as my goal right now is to simply have something that works then iterate towards something better. But if you'd like to follow along with what I've been doing, the dev branch is here: https://github.com/jasnell/node/tree/http2 |
@dougwilson @nodejs/http ... I would love to get input / perspective from the ecosystem of HTTP-related module / framework developers on what would be required (if anything) from Core with regards to HTTP/2 support. |
I think this probably doesn't need to be in the CTC-specific repo anymore. There's an issue in the NG repo and @jasnell is working on an implementation. Seems like further discussion could probably happen in the main node repo if necessary. Closing. Feel free to re-open if you disagree. |
We've had an on again off again discussion happening for some time about getting http/2 support into core. While http/2 has it's challenges, use is growing and there are real benefits realized through its use. I think it's worth moving forward on.
In a brief conversation with @indutny regarding node-spdy (his spdy and http2 implementation), he indicated that node-spdy is not yet fully compliant or optimized enough to the spec and would need additional work. It could give us a good place to start, however, to figure out what would need to be done to get http/2 support in core.
There are a few key concerns that we would need to look at (here are a few off the top of my head):
'push'
event on aClientRequest
object would make the most sense here but we would need to work through the API details.Ultimately, I believe this is something that needs to be implemented and I plan to start work on this in the very near future (matter of weeks), beginning with a rough outline of the new API. What I hope to do is begin introducing experimental support for http/2 in the same basic way that we've handled async_wrap -- that is, slowing introducing the elements into core as unsupported experimental bits. It will take some time to get right.
Implementations: https://github.com/http2/http2-spec/wiki/Implementations
The text was updated successfully, but these errors were encountered: