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
{{ message }}
Repository navigation
Need backward compatibility to use http1 on Http2Server #18554
Since 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?
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?
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.
Reacted by GP, Stefano Cappa, Páll Árpád and v1rtl
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.
Activity
trivikr commentedon Feb 8, 2018
Any update on this request?
devsnek commentedon Feb 8, 2018
cc @nodejs/http2
jasnell commentedon Feb 8, 2018
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
trivikr commentedon Feb 8, 2018
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?
mcollina commentedon Feb 8, 2018
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.
jasnell commentedon Aug 10, 2018
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.