RPC WebSocket is a wrapper for standard WebSocket that adds support for message types, RPC calls, and before/after send/receive event hooks. Version 0.7.6 is the latest release; the package has not seen updates since 2016 and is in maintenance mode with known issues. It provides a lightweight alternative to Socket.io for simple RPC over WebSocket, lacking built-in reconnection or authentication. Works in both Node.js and browser environments. Note: The package is not actively maintained and may have compatibility issues with modern WebSocket APIs and module systems.
npm install rpc-websocketNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating an RPC WebSocket connection to a test server, calling an RPC method, and using message types for send/receive.
Consider migrating to a maintained alternative like Socket.io or ws with custom RPC layer.
Ensure you are using a compatible WebSocket implementation (e.g., the 'ws' package in Node.js). Check your Node.js version.
Attach error listener directly on underlying WebSocket instance via ws.ws.on('error', ...) for reliable error handling.The package does not deduplicate listeners; each call to ws.on(type, cb) adds a new listener. Use removeListener if needed.
npm install rpc-websocket and use ES module import syntax.
Wrap rpc calls inside the 'open' event callback.
Ensure payload is UTF-8 encoded string; binary data is not natively supported.
No dependency data recorded yet.