spdy-http2 / node-spdy

SPDY server on Node.js
2.81k stars 196 forks source link

Node internals usage #333

Open addaleax opened 6 years ago

addaleax commented 6 years ago

Hi everyone!

As you probably know (because you are maintaining this code) spdy currently makes heavy use of assumptions about Node's internals, and in particular I'm thinking about the whole handle-thing stuff.

Obviously, breaking ecosystem modules like spdy is not a goal for Node, but this still puts Node core maintainers in a situation where it's unreasonable to take special care about not breaking spdy when the rest of the ecosystem, who plays by the rules and relies on public APIs instead, would benefit from changes.

So:

jgautier commented 5 years ago

@addaleax I am interested in getting this module to work in node v10. I am curious if you have any idea what the breaking were changes were in node core?

@diasdavid Has there any been any work already on making this work with v10?

addaleax commented 5 years ago

@jgautier I wasn’t even aware that this is broken on Node 10 (and I’m not sure it was when I originally posted this).

Looking it up, we removed it from our internal test matrix in https://github.com/nodejs/citgm/pull/564:

SPDY relies on spdy-transport and that broke due to a BC in 10.0.0. However, neither of these modules are maintained anymore as they got pretty much obsolete due to http2.

I would agree with that assessment, it’s a good idea to migrate away from it altogether.

vytautas-pranskunas- commented 5 years ago

So what are the recommendations? Any ideas on how to fix it - nodejs 10+ to get working with spdy?

coolaj86 commented 5 years ago

@vytautas-pranskunas- Check the comments at the bottom of https://github.com/spdy-http2/node-spdy/issues/343

The problem, as I understand it, is that fixing v10 (current) breaks v8 (stable).

Perhaps someone (https://github.com/spdy-http2/node-spdy/issues/339) could publish a new version with the updates and make good use of the engines field in package.json https://docs.npmjs.com/files/package.json#engines

As to the topic at hand... I have no idea how anyone can do any degree of network protocol work in node without relying on internal APIs... it's a jungle of very difficult to navigate code and not much is exposed to the outside world (though it's getting better all the time).

I myself have code that will only run on early versions of v8, none of v9, and only early versions of v10 because I'm operating in-between the tls and net layers, which were not build to be used independently. I imagine spdy suffers from similar issues.