Gathering detailed insights and metrics for rpc-websockets
Gathering detailed insights and metrics for rpc-websockets
Gathering detailed insights and metrics for rpc-websockets
Gathering detailed insights and metrics for rpc-websockets
@solana/rpc-subscriptions-transport-websocket
An RPC Subscriptions transport that uses WebSockets
@solana/rpc-subscriptions-channel-websocket
An RPC Subscriptions transport that uses WebSockets
rpc-ws
JSON-RPC 2.0 implementation with websockets
@0x/mesh-rpc-client
A Javascript library for interacting with the Mesh JSON RPC API over WebSockets
JSON-RPC 2.0 implementation over WebSockets for Node.js and JavaScript/TypeScript
npm install rpc-websockets
Typescript
Module System
Node Version
NPM Version
97
Supply Chain
99
Quality
92.9
Maintenance
100
Vulnerability
81.3
License
JavaScript (58.76%)
TypeScript (41.24%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
69,442,017
Last Day
135,332
Last Week
762,986
Last Month
3,303,180
Last Year
21,955,256
NOASSERTION License
603 Stars
496 Commits
127 Forks
15 Watchers
4 Branches
28 Contributors
Updated on Mar 10, 2025
Minified
Minified + Gzipped
Latest Version
10.0.0
Package Id
rpc-websockets@10.0.0
Unpacked Size
345.40 kB
Size
59.47 kB
File Count
16
NPM Version
8.11.0
Node Version
16.16.0
Published on
Mar 08, 2025
Cumulative downloads
Total Downloads
Last Day
-0.7%
135,332
Compared to previous day
Last Week
-6.4%
762,986
Compared to previous week
Last Month
50.1%
3,303,180
Compared to previous month
Last Year
10%
21,955,256
Compared to previous year
14
2
The rpc-websockets library enables developers to easily implement their business logic that includes messaging between users, machines or any devices. It provides a possibility to send and receive JSON data through the WebSocket communication protocol in order to support two-way notification push, running RPC methods and firing any types of event signalling. Only clients can call RPC methods and not vice versa at the moment. Both frontend (HTML/JS-based) and backend (Node.js-based) development environments are supported.
rpc-websockets is built on Node.js and supports both LTS and Current versions.
Use the free OSS edition in order to implement and manage your own WebSocket server instances, or subscribe for our Pro plan and have us manage your instances and provide you with management of your methods, events and notifications on an easy-to-use Web Management portal.
Install our OSS library in your project:
npm install rpc-websockets
Write your source code using rpc-websockets
:
1var WebSocket = require('rpc-websockets').Client 2var WebSocketServer = require('rpc-websockets').Server 3 4// instantiate Server and start listening for requests 5var server = new WebSocketServer({ 6 port: 8080, 7 host: 'localhost' 8}) 9 10// register an RPC method 11server.register('sum', function(params) { 12 return params[0] + params[1] 13}) 14 15// ...and maybe a protected one also 16server.register('account', function() { 17 return ['confi1', 'confi2'] 18}).protected() 19 20// create an event 21server.event('feedUpdated') 22 23// get events 24console.log(server.eventList()) 25 26// emit an event to subscribers 27server.emit('feedUpdated') 28 29// close the server 30server.close() 31 32// instantiate Client and connect to an RPC server 33var ws = new WebSocket('ws://localhost:8080') 34 35ws.on('open', function() { 36 // call an RPC method with parameters 37 ws.call('sum', [5, 3]).then(function(result) { 38 require('assert').equal(result, 8) 39 }) 40 41 // send a notification to an RPC server 42 ws.notify('openedNewsModule') 43 44 // subscribe to receive an event 45 ws.subscribe('feedUpdated') 46 47 ws.on('feedUpdated', function() { 48 updateLogic() 49 }) 50 51 // unsubscribe from an event 52 ws.unsubscribe('feedUpdated') 53 54 // login your client to be able to use protected methods 55 ws.login({'username': 'confi1', 'password':'foobar'}).then(function() { 56 ws.call('account').then(function(result) { 57 require('assert').equal(result, ['confi1', 'confi2']) 58 }) 59 }).catch(function(error) { 60 console.log('auth failed') 61 }) 62 63 // close a websocket connection 64 ws.close() 65})
Please consult our API documentation for both WebSocket server and client JavaScript and TypeScript classes.
Features of the free open-source edition.
All library's open-source features are documented in our API documentation and can be used free of charge. You are free to implement your solutions based on provided methods in any way you are comfortable with, as long as you use our work along our very permissive license conditions.
In order to support your production-ready environments, we can provide you with additional features built on top of our free OSS edition along with the skill set to turn your business case or a Proof-of-Concept idea into reality.
Describe us your use case by contacting us and we will swiftly get back to you with a proposed solution that meets your needs.
We offer professional support for rpc-websockets and beyond. We have many years of expertise on building robust, scalable Node.js applications and can help you overcome issues and challenges preventing you to ship your great products. We excel in software architecture and implementation, being able to provide you with development, planning, consulting, training and customization services. Feel free to contact us so we can discuss how to help you finish your products!
rpc-websockets is being actively used in production by multiple companies in a variety of different use cases.
Become a sponsor and get your logo on project's README on GitHub with a link to your site. Feel free to contact us for the arrangement!
This library is licensed under LGPLv3. Please see LICENSE for licensing details.
No vulnerabilities found.
Reason
16 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
2 existing vulnerabilities detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More