4 ms·
The readme says Websockets support is native from Node 22, except Node does not have a native Websockets library. Their link for Websockets standard goes to MDN
by austin-cheney 4mo ago
The readme says Websockets support is native from Node 22, except Node does not have a native Websockets library. Their link for Websockets standard goes to MDN, which is fine except that only describes the WHATWG user interface and nothing about the protocol or how Websockets works.
It feels like this is missing something or using a nonnative library as a supplemental addition.
- soulofmischief 4mo agoNode supports a built-in WebSocket client since 22, but not a server.
- austin-cheney 4mo agoIn that case I guess this would be much more a Node complaint. I did find this page: https://nodejs.org/learn/getting-started/websocket https://nodejs.org/learn/getting-started/websocket It is under the site's learn tab, but never mentioned in the API/library documentation. It's also weird because the only difference between a WebSocket client and server is that a server is a connection listener that responds to the handshake. The client is responsible for absolutely everything else: send messages, receive messages, initiate the connection, kill the connection, ping/pong. After the client accepts the server's handshake response the server becomes the other client performing exactly the same functionality. Node could have been doing that all along since adding client support.