{"id":32149222,"url":"https://github.com/s2ler/smosquitto","last_synced_at":"2026-02-19T07:01:38.456Z","repository":{"id":63920455,"uuid":"164416882","full_name":"S2Ler/SMosquitto","owner":"S2Ler","description":"Lightweight Swift wrapper around libmosquitto client library.","archived":false,"fork":false,"pushed_at":"2021-10-11T20:41:19.000Z","size":80,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-26T08:33:56.161Z","etag":null,"topics":["iot","mosquitto","mqtt","mqtt-client","swift","swift-wrapper"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/S2Ler.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}},"created_at":"2019-01-07T10:34:53.000Z","updated_at":"2021-10-11T20:41:22.000Z","dependencies_parsed_at":"2023-01-14T14:00:50.243Z","dependency_job_id":null,"html_url":"https://github.com/S2Ler/SMosquitto","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/S2Ler/SMosquitto","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S2Ler%2FSMosquitto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S2Ler%2FSMosquitto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S2Ler%2FSMosquitto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S2Ler%2FSMosquitto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/S2Ler","download_url":"https://codeload.github.com/S2Ler/SMosquitto/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S2Ler%2FSMosquitto/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29605799,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T06:47:36.664Z","status":"ssl_error","status_checked_at":"2026-02-19T06:45:47.551Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["iot","mosquitto","mqtt","mqtt-client","swift","swift-wrapper"],"created_at":"2025-10-21T09:48:15.858Z","updated_at":"2026-02-19T07:01:38.451Z","avatar_url":"https://github.com/S2Ler.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SMoquitto\n\nSwift 5.0, macOS, Linux.\n\nA thin Swift wrapper for [libmosquitto](https://github.com/eclipse/mosquitto/tree/master/lib). Supports macOS and Linux.\n\n## Installation\n\nUse [SPM](https://swift.org/package-manager/).\n\nSample `Package.swift`\n```swift\n// swift-tools-version:5.0\nimport PackageDescription\n\nlet package = Package(\n  name: \"ProjectName\",\n  products: [\n    .executable(name: \"ProjectName\", targets: [\"ProjectName\"]),\n    ],\n  dependencies: [\n    .package(url: \"https://github.com/diejmon/SMosquitto.git\", .upToNextMinor(from: \"1.4.0\")),\n  ],\n  targets: [\n    .target(\n      name: \"ProjectName\",\n      dependencies: [\"SMosquitto\"]),\n  ],\n  swiftLanguageVersions: [.v5]\n)\n```\n\n## Usage\n\n```swift\nimport SMosquitto\n\nSMosquitto.initialize()\nlet smosquitto = SMosquitto(id: \"An ID\", cleanSession: true)\n\ntry smosquitto.setLoginInformation(username: \"username\", password: \"password\")\ntry smosquitto.connect(host: \"hostname\", port: 1883, keepalive: true)\n\nsmosquitto.onConnect = { response in\n      do {\n        // Subscribe for topics once connected to server. \n        try smosquitto.subscribe(subscriptionPattern: \"atopic\", qos: .atleastOnce)\n      }\n      catch {\n        // an error happened\n      }\n}\n\nsmosquitto.onMessage = { message in\n  // Do something with received message\n}\n\n/// Start async loop\ntry smosquitto.loopForever(timeout: .interval(45))\n```\n\n## Contributing\nPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.\nPlease make sure to update tests as appropriate.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs2ler%2Fsmosquitto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs2ler%2Fsmosquitto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs2ler%2Fsmosquitto/lists"}