{"id":13658315,"url":"https://github.com/icerockdev/moko-socket-io","last_synced_at":"2025-07-21T22:37:18.612Z","repository":{"id":48906772,"uuid":"261455652","full_name":"icerockdev/moko-socket-io","owner":"icerockdev","description":"MOKO SocketIo by IceRock is Socket.IO implementation Kotlin Multiplatform library","archived":false,"fork":false,"pushed_at":"2024-08-24T14:37:26.000Z","size":170,"stargazers_count":145,"open_issues_count":15,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-07T05:04:01.147Z","etag":null,"topics":["android","ios","kotlin","kotlin-multiplatform","kotlin-native","moko","socket-io"],"latest_commit_sha":null,"homepage":"https://moko.icerock.dev/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"2020-05-05T12:12:02.000Z","updated_at":"2025-05-01T02:42:04.000Z","dependencies_parsed_at":"2024-01-17T03:26:13.554Z","dependency_job_id":"675c6728-10d3-4523-adbf-8ed9483194d0","html_url":"https://github.com/icerockdev/moko-socket-io","commit_stats":{"total_commits":60,"total_committers":9,"mean_commits":6.666666666666667,"dds":0.7,"last_synced_commit":"36488af57ba786073fe663401097777144bf5101"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/icerockdev/moko-socket-io","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-socket-io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-socket-io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-socket-io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-socket-io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/moko-socket-io/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-socket-io/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266393652,"owners_count":23922425,"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-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["android","ios","kotlin","kotlin-multiplatform","kotlin-native","moko","socket-io"],"created_at":"2024-08-02T05:00:58.623Z","updated_at":"2025-07-21T22:37:18.589Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","funding_links":[],"categories":["Libraries","网络编程"],"sub_categories":["🌎 Network"],"readme":"![moko-socket-io](https://user-images.githubusercontent.com/5010169/80988267-712b7e80-8e5d-11ea-955e-c788a567c64e.png)  \n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/socket-io) ](https://repo1.maven.org/maven2/dev/icerock/moko/socket-io) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko\u0026name=socket-io)\n\n# Mobile Kotlin socket io\nThis is a Kotlin MultiPlatform library that provides real-time, event-based communication for iOS and Android.\n\n## Table of Contents\n- [Features](#features)\n- [Requirements](#requirements)\n- [Versions](#versions)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Samples](#samples)\n- [Set Up Locally](#set-up-locally)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- **Socket.IO in common code** - actual implementations is [socket.io-client-java](https://github.com/socketio/socket.io-client-java) and [socket.io-client-swift](https://github.com/socketio/socket.io-client-swift);\n\n## Requirements\n- Gradle version 6.8+\n- Android API 16+\n- iOS version 11.0+\n\n## Installation\n### root build.gradle  \n```groovy\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\n\n### project build.gradle\n```groovy\ndependencies {\n    commonMainApi(\"dev.icerock.moko:socket-io:0.6.0\")\n}\n```\n\n#### With JetBrains cocoapods plugin\nproject build.gradle\n```\nplugins {\n    kotlin(\"native.cocoapods\")\n}\n\n...\n\nkotlin {\n    cocoapods {\n        ...\n\n        // 11.0 minimal supported\n        ios.deploymentTarget = \"11.0\"\n        \n        // add native dependency\n        pod(name = \"mokoSocketIo\") {\n            source = git(url = \"https://github.com/icerockdev/moko-socket-io.git\") {\n                tag = \"release/0.6.0\"\n            }\n        }\n    }\n}\n```\nPodfile\n```\npod 'mokoSocketIo', :git =\u003e 'https://github.com/icerockdev/moko-socket-io.git', :tag =\u003e 'release/0.6.0'\n```\n\n(!) Check sample - https://github.com/Alex009/moko-socket-io-sample ([integration changes](https://github.com/Alex009/moko-socket-io-sample/commit/7439093217f9c041369540011d84d7109b2c1606))\n\n\n#### With IceRock cocoapods plugin\nproject build.gradle\n```\nplugins {\n    id(\"dev.icerock.mobile.multiplatform.cocoapods\")\n}\n\n...\n\ncocoaPods {\n    podsProject = file(\"../ios-app/Pods/Pods.xcodeproj\") // here should be path to Pods xcode project\n\n    pod(\"mokoSocketIo\", onlyLink = true)\n}\n```\n\nPodfile\n```ruby\npod 'mokoSocketIo', :git =\u003e 'https://github.com/icerockdev/moko-socket-io.git', :tag =\u003e 'release/0.6.0'\n```\n\n## Usage\n`common`:\n```kotlin\nval socket = Socket(\n    endpoint = \"wss://my-super-server:8080\",\n    config = SocketOptions(\n        queryParams = mapOf(\"token\" to \"MySuperToken\"),\n        transport = SocketOptions.Transport.WEBSOCKET\n    )\n) {\n    on(SocketEvent.Connect) {\n        println(\"connect\")\n    }\n\n    on(SocketEvent.Connecting) {\n        println(\"connecting\")\n    }\n\n    on(SocketEvent.Disconnect) {\n        println(\"disconnect\")\n    }\n\n    on(SocketEvent.Error) {\n        println(\"error $it\")\n    }\n\n    on(SocketEvent.Reconnect) {\n        println(\"reconnect\")\n    }\n\n    on(SocketEvent.ReconnectAttempt) {\n        println(\"reconnect attempt $it\")\n    }\n\n    on(SocketEvent.Ping) {\n        println(\"ping\")\n    }\n\n    on(SocketEvent.Pong) {\n        println(\"pong\")\n    }\n\n    on(\"employee.connected\") { data -\u003e\n        val serializer = DeliveryCar.serializer()\n        val json = JSON.nonstrict\n        val deliveryCar: DeliveryCar = json.parse(serializer, data)\n        //...\n    }\n}\n```\n\n## Samples\nPlease see more examples in the [sample directory](sample).\n\n## Set Up Locally \n- The [socket-io directory](socket-io) contains the `socket-io` library;\n- The [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps;\n\n## Contributing\nAll development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.\n\nThe `develop` branch is pushed to `master` on release.\n\nFor more details on contributing please see the [contributing guide](CONTRIBUTING.md).\n\n## License\n        \n    Copyright 2020 IceRock MAG Inc.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-socket-io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmoko-socket-io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-socket-io/lists"}