{"id":15287709,"url":"https://github.com/flukso/lua-mosquitto","last_synced_at":"2025-08-12T15:09:23.803Z","repository":{"id":6479948,"uuid":"7720097","full_name":"flukso/lua-mosquitto","owner":"flukso","description":"Lua bindings to the libmosquitto MQTT client library.","archived":false,"fork":false,"pushed_at":"2023-06-16T13:36:51.000Z","size":66,"stargazers_count":63,"open_issues_count":12,"forks_count":42,"subscribers_count":17,"default_branch":"master","last_synced_at":"2024-11-29T01:15:28.265Z","etag":null,"topics":["libmosquitto","lua","lua-bindings","mosquitto","mqtt","mqtt-client"],"latest_commit_sha":null,"homepage":"https://github.com/flukso/lua-mosquitto","language":"C","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/flukso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2013-01-20T18:36:57.000Z","updated_at":"2023-10-19T14:31:51.000Z","dependencies_parsed_at":"2024-06-18T18:43:18.820Z","dependency_job_id":null,"html_url":"https://github.com/flukso/lua-mosquitto","commit_stats":{"total_commits":54,"total_committers":8,"mean_commits":6.75,"dds":0.6111111111111112,"last_synced_commit":"46422c4d498254001407073426744c294ef1ea47"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flukso%2Flua-mosquitto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flukso%2Flua-mosquitto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flukso%2Flua-mosquitto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flukso%2Flua-mosquitto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flukso","download_url":"https://codeload.github.com/flukso/lua-mosquitto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227457133,"owners_count":17777944,"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":["libmosquitto","lua","lua-bindings","mosquitto","mqtt","mqtt-client"],"created_at":"2024-09-30T15:35:28.270Z","updated_at":"2024-12-19T13:08:07.328Z","avatar_url":"https://github.com/flukso.png","language":"C","readme":"lua-mosquitto\n=============\n\nLua bindings to the [libmosquitto](http://www.mosquitto.org/) client library.\n\nThe parameters to all functions are as per [libmosquitto's api](http://mosquitto.org/api)\nonly with sensible defaults for optional values, and return values directly\nrather than via pointers.\n\nGenerated API documentation for the lua functions [is also available](docs/)\n([Direct link if you are within github](https://flukso.github.io/lua-mosquitto/docs))\n\nCompile\n-------\nYou need Lua and mosquitto development packages (headers and libs) to\nbuild lua-mosquitto.\n\nCompile with\n\n    make\n\nYou can override the pkg-config package name to set a specific Lua version.\nFor example:\n\n    make LUAPKG=lua5.2\n\nExample usage\n-------------\n\nHere is a very simple example that subscribes to the broker $SYS topic tree\nand prints out the resulting messages:\n\n```Lua\nmqtt = require(\"mosquitto\")\nclient = mqtt.new()\n\nclient.ON_CONNECT = function()\n        print(\"connected\")\n        client:subscribe(\"$SYS/#\")\n        local mid = client:subscribe(\"complicated/topic\", 2)\nend\n\nclient.ON_MESSAGE = function(mid, topic, payload)\n        print(topic, payload)\nend\n\nbroker = arg[1] -- defaults to \"localhost\" if arg not set\nclient:connect(broker)\nclient:loop_forever()\n```\n\nHere is another simple example that will just publish a single message,\n\"hello\", to the topic \"world\" and then disconnect.\n\n```Lua\nmqtt = require(\"mosquitto\")\nclient = mqtt.new()\n\nclient.ON_CONNECT = function()\n        client:publish(\"world\", \"hello\")\n        local qos = 1\n        local retain = true\n        local mid = client:publish(\"my/topic/\", \"my payload\", qos, retain)\nend\n\nclient.ON_PUBLISH = function()\n\tclient:disconnect()\nend\n\nbroker = arg[1] -- defaults to \"localhost\" if arg not set\nclient:connect(broker)\nclient:loop_forever()\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflukso%2Flua-mosquitto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflukso%2Flua-mosquitto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflukso%2Flua-mosquitto/lists"}