{"id":13451918,"url":"https://github.com/moscajs/mosca","last_synced_at":"2025-09-27T08:31:00.035Z","repository":{"id":37470081,"uuid":"8222042","full_name":"moscajs/mosca","owner":"moscajs","description":"MQTT broker as a module","archived":true,"fork":false,"pushed_at":"2020-01-31T18:27:49.000Z","size":7031,"stargazers_count":3199,"open_issues_count":122,"forks_count":505,"subscribers_count":191,"default_branch":"master","last_synced_at":"2025-09-23T23:11:05.150Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"mosca.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moscajs.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-02-15T16:45:20.000Z","updated_at":"2025-09-17T07:04:56.000Z","dependencies_parsed_at":"2022-09-26T16:22:41.720Z","dependency_job_id":null,"html_url":"https://github.com/moscajs/mosca","commit_stats":null,"previous_names":["mcollina/mosca"],"tags_count":98,"template":false,"template_full_name":null,"purl":"pkg:github/moscajs/mosca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moscajs%2Fmosca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moscajs%2Fmosca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moscajs%2Fmosca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moscajs%2Fmosca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moscajs","download_url":"https://codeload.github.com/moscajs/mosca/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moscajs%2Fmosca/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276678841,"owners_count":25684803,"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","status":"online","status_checked_at":"2025-09-23T02:00:09.130Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-07-31T07:01:06.901Z","updated_at":"2025-09-27T08:30:59.641Z","avatar_url":"https://github.com/moscajs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"Mosca\u0026nbsp;\u0026nbsp;\u0026nbsp;[![Build Status](https://travis-ci.org/mcollina/mosca.svg)](https://travis-ci.org/mcollina/mosca)\u0026nbsp;\u0026nbsp;[![Coverage Status](https://coveralls.io/repos/mcollina/mosca/badge.svg)](https://coveralls.io/r/mcollina/mosca)\n====================\n\n[![MOSCA](http://cloud.dynamatik.com/image/3I3I0q1M1x0E/mosca_small.png)](https://github.com/mcollina/mosca)\n\n[![NPM](https://nodei.co/npm/mosca.png)](https://nodei.co/npm/mosca/)\n\n[![NPM](https://nodei.co/npm-dl/mosca.png)](https://nodei.co/npm/mosca/)\n\n## This project is UNMAINTAINED. Please move to [Aedes](https://github.com/moscajs/aedes)\n\n## About\n\n#### Mosca is a node.js mqtt broker, which can be used:\n\n* \u003ca href=\"https://github.com/mcollina/mosca/wiki/Mosca-as-a-standalone-service.\"\u003eStandalone\u003c/a\u003e\n* \u003ca href=\"https://github.com/mcollina/mosca/wiki/Mosca-basic-usage\"\u003eEmbedded in another Node.js application\u003c/a\u003e\n\n## Features\n\n* MQTT 3.1 and 3.1.1 compliant.\n* QoS 0 and QoS 1.\n* Various storage options for QoS 1 offline packets, and subscriptions.\n* Usable inside ANY other Node.js app.\n* version 2.0.0+ targets node v6, v4 and v0.12\n* version 1.0.0+ targets node v6, v5, v4 and v0.12, with partial support for node v0.10.\n\n## Quickstart\n\n### Standalone\n\n```bash\nnpm install mosca pino -g\nmosca -v | pino\n```\n\n### Embedded\n\n```bash\nnpm install mosca --save\n```\n\nShow me some code:\n\n```javascript\nvar mosca = require('mosca');\n\nvar ascoltatore = {\n  //using ascoltatore\n  type: 'mongo',\n  url: 'mongodb://localhost:27017/mqtt',\n  pubsubCollection: 'ascoltatori',\n  mongo: {}\n};\n\nvar settings = {\n  port: 1883,\n  backend: ascoltatore\n};\n\nvar server = new mosca.Server(settings);\n\nserver.on('clientConnected', function(client) {\n    console.log('client connected', client.id);\n});\n\n// fired when a message is received\nserver.on('published', function(packet, client) {\n  console.log('Published', packet.payload);\n});\n\nserver.on('ready', setup);\n\n// fired when the mqtt server is ready\nfunction setup() {\n  console.log('Mosca server is up and running');\n}\n```\n\nAll the info to get you started is gathered [in this wiki page](https://github.com/mcollina/mosca/wiki/Mosca-basic-usage)\n\nAlso there is an example using [Redis](https://github.com/mcollina/mosca/wiki/Mosca-basic-usage#in-this-example-we-will-be-using-redis)\n\n## How to's/Tutorials\n\nAll to be found [on our repository wiki section.](https://github.com/mcollina/mosca/wiki)\n\nOR\n\nread the [dox generated documentation](http://mcollina.github.io/mosca/docs).\n\n\n### Learn more\n\nSee the slides of my talk [\"MQTT and Node.js - Messaging in the Internet\nof Things\"](http://mcollina.github.io/mqtt_and_nodejs/).\n\nYou can find a test version of mosca at test.mosca.io.\nYou can use ws://test.mosca.io/ to connect to the WebSocket tunnel.\nThis is powered by the [docker image](https://github.com/mcollina/mosca/wiki/Docker-support).\n\nIf you find Mosca useful, consider supporting the project by buying a support package\nfrom [me](http://twitter.com/matteocollina) by writing an email to hello@matteocollina.com.\n\nCheck out our [showcase](https://github.com/mcollina/mosca/wiki/Mosca-Showcase) wiki\npage! Feel free to add yourself! :)\n\n## Security Issues\n\n__Mosca__ sits between your system and the devices: this is a tough role, and we did our best to secure your systems.\nHowever, you might find a security issue: in that case, email @mcollina at hello@matteocollina.com.\n\n\n## Feedback\n\nUse the [issue tracker](http://github.com/mcollina/mosca/issues) for bugs.\n[Tweet](http://twitter.com/matteocollina) us for any idea that can improve the project.\nChat with us on [Mosca's room](https://gitter.im/mcollina/mosca) on Gitter.\n\n\n## Links\n\n* [GIT Repository](http://github.com/mcollina/mosca)\n* [Mosca Documentation](http://mcollina.github.io/mosca/docs)\n* [Ascoltatori](http://github.com/mcollina/ascoltatori)\n* [MQTT protocol](http://mqtt.org)\n* [MQTT.js](http://github.com/adamvr/MQTT.js)\n\n## Authors\n\n[Matteo Collina](http://twitter.com/matteocollina)\n\n## Logo\n[Sam Beck](http://two-thirty.tumblr.com)\n\n\n## LICENSE - \"MIT License\"\n\nCopyright (c) 2013-2016 Matteo Collina, http://matteocollina.com\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoscajs%2Fmosca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoscajs%2Fmosca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoscajs%2Fmosca/lists"}