{"id":13454529,"url":"https://github.com/elpheria/rpc-websockets","last_synced_at":"2025-05-13T23:10:04.369Z","repository":{"id":39801227,"uuid":"70642405","full_name":"elpheria/rpc-websockets","owner":"elpheria","description":"JSON-RPC 2.0 implementation over WebSockets for Node.js and JavaScript/TypeScript","archived":false,"fork":false,"pushed_at":"2025-03-08T14:17:13.000Z","size":5396,"stargazers_count":608,"open_issues_count":13,"forks_count":127,"subscribers_count":15,"default_branch":"trunk","last_synced_at":"2025-05-02T07:01:45.987Z","etag":null,"topics":["aws","chat","distributed-systems","events","gcp","iot","messaging","multiplayer","nodejs","push-notifications","remote-procedure-calls","rpc","rpc-api","rpc-client","rpc-framework","rpc-server","scalable","serverless","typescript","websocket-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elpheria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://paypal.me/kozjak"]}},"created_at":"2016-10-11T23:01:26.000Z","updated_at":"2025-04-20T23:06:47.000Z","dependencies_parsed_at":"2023-02-08T18:31:45.313Z","dependency_job_id":"a3e07f75-4767-4e56-b64b-2a1ad5b6427e","html_url":"https://github.com/elpheria/rpc-websockets","commit_stats":{"total_commits":416,"total_committers":33,"mean_commits":"12.606060606060606","dds":"0.17788461538461542","last_synced_commit":"10619b2e95a8e5b857a39ccf6aac3ca4e175b184"},"previous_names":[],"tags_count":91,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elpheria%2Frpc-websockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elpheria%2Frpc-websockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elpheria%2Frpc-websockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elpheria%2Frpc-websockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elpheria","download_url":"https://codeload.github.com/elpheria/rpc-websockets/tar.gz/refs/heads/trunk","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253877312,"owners_count":21977633,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","chat","distributed-systems","events","gcp","iot","messaging","multiplayer","nodejs","push-notifications","remote-procedure-calls","rpc","rpc-api","rpc-client","rpc-framework","rpc-server","scalable","serverless","typescript","websocket-server"],"created_at":"2024-07-31T08:00:55.038Z","updated_at":"2025-05-13T23:09:59.356Z","avatar_url":"https://github.com/elpheria.png","language":"JavaScript","funding_links":["https://paypal.me/kozjak"],"categories":["Packages","JavaScript","Repository","typescript","包","目录","aws","Real-time","Tools per Language","Modules"],"sub_categories":["Real-time","实时","即时通信","Node.js"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/elpheria/rpc-websockets\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/logo.png\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\n  \u003cp\u003e\n    WebSockets for \u003ca href=\"http://nodejs.org\"\u003eNode.js\u003c/a\u003e and \u003ca href=\"https://en.wikipedia.org/wiki/JavaScript\"\u003eJavaScript\u003c/a\u003e/\u003ca href=\"https://en.wikipedia.org/wiki/TypeScript\"\u003eTypeScript\u003c/a\u003e with \u003ca href=\"https://www.jsonrpc.org/specification\"\u003eJSON RPC 2.0\u003c/a\u003e support on top.  \u003c/p\u003e\n  \u003ca href=\"https://www.npmjs.com/package/rpc-websockets\"\u003e\n                \u003cimg src=\"https://img.shields.io/npm/v/rpc-websockets.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/elpheria/rpc-websockets\"\u003e\n\t\t\u003cimg src=\"https://travis-ci.org/elpheria/rpc-websockets.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/elpheria/rpc-websockets?branch=master\"\u003e\n\t\t\u003cimg src=\"https://coveralls.io/repos/github/elpheria/rpc-websockets/badge.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/rpc-websockets\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/rpc-websockets.svg?maxAge=2592000\"\u003e\n  \u003c/a\u003e\n  \u003cbr\u003e\u003cbr\u003e\u003cbr\u003e\n\u003c/div\u003e\n\n## About\n\nThe **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.\n\n**rpc-websockets** is built on Node.js and supports both LTS and Current versions.\n\nUse the free OSS edition in order to implement and manage your own WebSocket server instances, or subscribe for our [Pro plan](#pro-features) 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.\n\n## Quick start\n\nInstall our OSS library in your project:\n```\nnpm install rpc-websockets\n```\n\nWrite your source code using `rpc-websockets`:\n```js\nvar WebSocket = require('rpc-websockets').Client\nvar WebSocketServer = require('rpc-websockets').Server\n\n// instantiate Server and start listening for requests\nvar server = new WebSocketServer({\n  port: 8080,\n  host: 'localhost'\n})\n\n// register an RPC method\nserver.register('sum', function(params) {\n  return params[0] + params[1]\n})\n\n// ...and maybe a protected one also\nserver.register('account', function() {\n  return ['confi1', 'confi2']\n}).protected()\n\n// create an event\nserver.event('feedUpdated')\n\n// get events\nconsole.log(server.eventList())\n\n// emit an event to subscribers\nserver.emit('feedUpdated')\n\n// close the server\nserver.close()\n\n// instantiate Client and connect to an RPC server\nvar ws = new WebSocket('ws://localhost:8080')\n\nws.on('open', function() {\n  // call an RPC method with parameters\n  ws.call('sum', [5, 3]).then(function(result) {\n    require('assert').equal(result, 8)\n  })\n\n  // send a notification to an RPC server\n  ws.notify('openedNewsModule')\n\n  // subscribe to receive an event\n  ws.subscribe('feedUpdated')\n\n  ws.on('feedUpdated', function() {\n    updateLogic()\n  })\n\n  // unsubscribe from an event\n  ws.unsubscribe('feedUpdated')\n\n  // login your client to be able to use protected methods\n  ws.login({'username': 'confi1', 'password':'foobar'}).then(function() {\n    ws.call('account').then(function(result) {\n      require('assert').equal(result, ['confi1', 'confi2'])\n    })\n  }).catch(function(error) {\n    console.log('auth failed')\n  })\n\n  // close a websocket connection\n  ws.close()\n})\n```\n\n## Documentation\n\nPlease consult our [API documentation](API.md) for both WebSocket server and client JavaScript and TypeScript classes.\n\n## OSS Features\n\nFeatures of the free open-source edition.\n\n![OSS Features](assets/oss-features.png)\n\nAll library's open-source features are documented in our [API documentation](API.md) 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](LICENSE) conditions.\n\n## Pro Features\n\nIn 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.\n\n![Pro Features](assets/pro-features.png)\n\nDescribe us your use case by [contacting us](mailto:info@elpheria.com?subject=Pro%20Plan%20enquiry) and we will swiftly get back to you with a proposed solution that meets your needs.\n\n## Professional support\n\nWe 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](mailto:support@elpheria.com?subject=rpc-websockets%20support%20enquiry) so we can discuss how to help you finish your products!\n\n## Users\n\n**rpc-websockets** is being actively used in production by multiple companies in a variety of different use cases.\n\n\u003cbr\u003e\n\u003ca href=\"https://scratchbox.io\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-scratchbox.png\" alt=\"Scratchbox\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://loomx.io\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-loom.png\" alt=\"Loom Network\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://www.uniqcast.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-uniqcast.png\" alt=\"uniqCast\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://leapdao.org\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-leapdao.png\" alt=\"LeapDAO\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://klika-tech.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-klikatech.png\" alt=\"Klika Tech, Inc.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://kodebox.io\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-kodebox.png\" alt=\"Kodebox, Inc.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://hey.network\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-heynetwork.png\" alt=\"Hey-Group S.A./N.V.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://www.hylo.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-hylo.png\" alt=\"Hylo, Inc.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://witnet.foundation\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-witnet.png\" alt=\"Witnet Foundation\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://www.scaleleap.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-scaleleap.png\" alt=\"Scale Leap\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://codice.org\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-codice.png\" alt=\"Codice Foundation, Inc.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://holo.host\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-holo.png\" alt=\"Holo Ltd.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://solana.com\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-solana.png\" alt=\"Solana Labs, Inc.\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\u003ca href=\"https://filecoin.io\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/elpheria/rpc-websockets/master/assets/user-filecoin.png\" alt=\"Filecoin\" height=50px\u003e\u003c/a\u003e\u0026emsp;\n\n## Sponsors\nBecome a sponsor and get your logo on project's README on GitHub with a link to your site. Feel free to [contact us](mailto:info@elpheria.com?subject=Sponsors) for the arrangement!\n\n## License\n\nThis library is licensed under LGPLv3. Please see [LICENSE](LICENSE) for licensing details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felpheria%2Frpc-websockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felpheria%2Frpc-websockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felpheria%2Frpc-websockets/lists"}