Coder Social home page Coder Social logo

Comments (6)

mastermatt avatar mastermatt commented on May 3, 2024 1

HTTP2 has been in Node for several years now. Closing this issue from lack of activity and any further HTTP2 discussions would probably belong in their own issue anyway.

from discussions.

hacksparrow avatar hacksparrow commented on May 3, 2024

It would be great to have fully compliant native HTTP/2 support in Node.js.

My understanding is that Express does not have to deal with the request and response objects at the HTTP protocol level, so as long as the request and response objects are HTTP/2-ready, Express should work just fine.

We might need to add additional methods and properties, though. I haven't though much about them yet.

from discussions.

jasnell avatar jasnell commented on May 3, 2024

One of the key questions with moving forward on this is whether or not the HTTP/2 implementation should seek to maintain API compatibility with the existing HTTP module API. For the overwhelming majority of it, it should be fairly easy to ensure API compatibility but there are a few areas where it simply is not practical -- push streams, for instance, and the fact that there's no such thing as a status message in HTTP/2. For the most part, the API would be nearly identical but, as we all know, the devil is in the details and small API changes could lead to significant issues. So I guess the main thing to figure out would be which parts of the API are ok to change, which parts are not, and what is the best process for staging out those changes in the code.

Another point is that while implementing the HTTP/2 support, we could take the opportunity to make necessary improvements on the existing API design in order to make it more efficient, more manageable, and easier to evolve over time.... but, I'd rather not break everything in the process.

from discussions.

jonathanong avatar jonathanong commented on May 3, 2024

i don't mind if it's in node core or not, only that it's part of the node foundation and there's only one. i just don't want to choose between supporting multiple http2 servers.

from discussions.

tunniclm avatar tunniclm commented on May 3, 2024

I did some investigation while attempting to get the node-http2 module working properly with Express. This module managed to keep a very similar API to the core https module. The main reason Express wouldn't work properly with the module was due to its different inheritance chain for request and response objects compared to the core http/https.

Express messes with the __proto__ of the request and response in order to inject its own api extension methods into the inheritance chain. I saw some commentary indicating this approach was taken (despite being fairly brittle) for performance reasons. I don't have any results to back that up though. The problematic part is that Express assumes the request/response will have a particular __proto__ and replaces it with its own that, in turn defers to the assumed original. In the case of node-http2 this is an incorrect assumption and it breaks.

The other concern that has been raised is less specific to HTTP/2, but interesting nonetheless: that is that there have been naming clashes between new versions of the http/https request and response objects and the additional Express methods. I think this was already discussed somewhere within the http working group, so perhaps a solution already exists for this potential issue.

from discussions.

jasnell avatar jasnell commented on May 3, 2024

Beginnings of the nodejs proposal: nodejs/node-eps#38

from discussions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.