liqd-websocket v1.2.3 is a lightweight WebSocket library for Node.js, offering a simple API for creating WebSocket clients and servers. It is designed for stability with infrequent releases. Differentiators include a minimal footprint and dependency on Node.js native 'crypto' for WebSocket handshake validation. It supports both server and client modes with event-driven messaging.
npm install liqd-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a WebSocket server on port 8080 and handles client connections, messages, and disconnection.
Consider using a library like 'ws' if compression is required.
Use data.toString() inside the event handler.
Manually JSON.stringify data before sending.
Ensure you use createServer({ port: 8080 }) without additional new.Check the server path option: createServer({ port: 8080, path: '/ws' }) and connect accordingly.