Details:
Http2SecureServer https://github.com/nodejs/node/blob/6d84ecefcd7da51ee5f9613f745ba5d0a9818726/lib/internal/http2/core.js#L2456-L2457allowHTTP1 in options for Http2ServerSince microservices are updated independently of each other, we need a way to provide backward compatibility for http2 plain text server. Is there a plan to provide such option for Http2Server?
Any update on this request?
cc @nodejs/http2
This is not yet possible with plain text http2 because the fallback mechanism depends entirely on the use of the ALPN tls extension.
Working on this is not currently in plan for me but I'm happy to review PRs if anyone wants to tackle it
I'd written some unit tests for NodeJS HTTP/2 in the past, and have an idea about how core.js works.
I can take this up. Any tips/suggestions on where to start wrt ALPN?
Any tips/suggestions on where to start wrt ALPN?
ALPN is already supported, it is the mechanism to support both HTTP/1.1 and HTTP/2 over the secure channel. Basically ALPN is used to kickstart the connection.
Upgrading from a plain text HTTP1 to HTTP2 would mean to use a similar flow to what is used for websockets (check out https://www.npmjs.com/package/ws) to upgrade the socket.
It might very well be possible that this flow could happen 80% in the ecosystem but we would need a little bit of support from Node core. This would be my preferred path.
I'm also ok in implement it fully within Node.js itself.
At this point in time, there's really no plan to implement this in core. The current implementation should not preclude anyone from providing an implementation that uses a similar http/1 upgrade path as is used by bootstrapping websockets.
Most helpful comment
ALPN is already supported, it is the mechanism to support both HTTP/1.1 and HTTP/2 over the secure channel. Basically ALPN is used to kickstart the connection.
Upgrading from a plain text HTTP1 to HTTP2 would mean to use a similar flow to what is used for websockets (check out https://www.npmjs.com/package/ws) to upgrade the socket.
It might very well be possible that this flow could happen 80% in the ecosystem but we would need a little bit of support from Node core. This would be my preferred path.
I'm also ok in implement it fully within Node.js itself.