nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
107.09k stars 29.33k forks source link

[Tracking Issue] Direct Sockets API #47511

Open GrapeGreen opened 1 year ago

GrapeGreen commented 1 year ago

Dear NodeJS team,

A year and a half ago @jasnell kicked off a discussion for a new unified net/tls/udp API (#40067); one of the options for alignment mentioned there was the Direct Sockets API (ex Raw Sockets) which has significantly evolved since then.

I'd like to revive that thread and ask you to share your thoughts on the general matter and the potential for future alignment. The API is currently in a limited developer trial, so there's plenty of room for incorporating new feedback and altering the API shape.

Same as in the previous thread, I'm fully aware that NodeJS has its own networking stack and API, so I'd like to stress that there's no intent to introduce any breaking changes nor alter the existing APIs; I believe that the Direct Sockets API could serve as a nice addition to the current stack and bridge the gap between NodeJS and the Web Platform.

I would be happy to discuss further if you are interested!

bnoordhuis commented 1 year ago

As long as it's a) not a standard, and b) not seeing broad adoption elsewhere, I don't see node implementing the proposal.

What could work is publishing it as a native module (e.g. using n-api) so people can try it out.

jasnell commented 1 year ago

Yes, I'll be implementing the proposal I discussed for Node.js. I'm currently waiting for some of the design bits to stabilize. Current expected timeline to start is late May or June this year

GrapeGreen commented 1 year ago

@jasnell are you talking about your Sockets API or Direct Sockets (or are there any other proposals)? Feeling a bit confused :)

jasnell commented 1 year ago

Yes lol. Either both. This is one of the API design issues that need to be resolved