{"id":21626715,"url":"https://github.com/rtakland/kwsify","last_synced_at":"2025-05-07T03:40:57.847Z","repository":{"id":194318624,"uuid":"690570318","full_name":"RTAkland/kwsify","owner":"RTAkland","description":"基于websocket的实时sub/pub服务","archived":false,"fork":false,"pushed_at":"2025-01-17T09:49:03.000Z","size":244,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T05:51:10.330Z","etag":null,"topics":["kotlin","pubsub","realtime","server","websocket"],"latest_commit_sha":null,"homepage":"","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/RTAkland.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":"2023-09-12T12:57:50.000Z","updated_at":"2025-01-17T09:49:04.000Z","dependencies_parsed_at":"2025-01-04T08:40:33.679Z","dependency_job_id":"7af0aa55-626f-4c04-a6cc-fd4304bb1a28","html_url":"https://github.com/RTAkland/kwsify","commit_stats":null,"previous_names":["rtakland/kwsify"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTAkland%2Fkwsify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTAkland%2Fkwsify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTAkland%2Fkwsify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RTAkland%2Fkwsify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RTAkland","download_url":"https://codeload.github.com/RTAkland/kwsify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252810119,"owners_count":21807756,"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":["kotlin","pubsub","realtime","server","websocket"],"created_at":"2024-11-25T01:14:10.980Z","updated_at":"2025-05-07T03:40:57.803Z","avatar_url":"https://github.com/RTAkland.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://rtakland.github.io/Static/static/kwsify.png\" alt=\"head\" width=\"128\"\u003e\n  \u003cbr\u003e\n  \u003ch3\u003e\u003cem\u003e基于websocket的实时通信服务\u003c/em\u003e\u003c/h3\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://rtakland.github.io/Static/static/kotlin/made-with-kotlin.svg\" alt=\"madeWithKotlin\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/RTAkland/kwsify/main.yml\" alt=\"buildState\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Kotlin-v2.0.21-pink?logo=Kotlin\" alt=\"KtV\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/LICENSE-Apache2.0-green?logo=apache\" alt=\"license\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/JVM-1.8+-red?logo=Openjdk\u0026link=https://a.com\" alt=\"jvm\"\u003e\n\n\u003c/div\u003e\n\n# 使用\n\n\u003e kwsify使用二进制来发送数据包, 这就意味着你不能使用wscat之类的\n\u003e 纯文本websocket调试器来调试服务端, 我会在下面的文档中给出所有数据包的偏移值\n\n文档地址: https://docs.rtast.cn/#/docs/kwsify/kwsify\n\n[这里](https://repo.rtast.cn/RTAkland/rautiotransfer)是一个示例项目用于将本地的音频文件传输给其他客户端\n\n## 服务端\n\n### 构建\n\n```shell\n$ chmod +x ./gradlew  # 可选\n$ ./gradlew buildShadowJar\n```\n\n```shell\n$ java -jar kwsify.jar [--port 8989]\n```\n\n## SDK\n\n### 添加Maven仓库\n\n```kotlin\nrepositories {\n    maven(\"https://repo.maven.rtast.cn/releases\")\n}\n\n```\n\n### 添加依赖\n\n```kotlin\ndependencies {\n    implementation(\"cn.rtast:kwsify-api:2.0.0\")  // 替换成最新版本\n}\n```\n\n\u003e 点[这里](https://pkg.rtast.cn/#/releases/cn/rtast/kwsify-api)查看所有版本(记得使用`api`模块而不是`server`模块)\n\n### 开始使用\n\n```kotlin\nfun main() {\n    val wsify = Kwsify(\"ws://127.0.0.1:8080\")\n    wsify.subscribe(\"test\", true, object : Subscriber {\n        override fun onMessage(channel: String, payload: ByteArray, packet: OutboundMessageBytesPacket) {\n            // payload是完整的二进制数据包, packet.body是ByteArray形式的任意数据如果确定发送的是纯文本\n            // 那么直接使用String(packet.body)即可还原出纯文本\n            println(String(packet.body))\n          \n        }\n\n        override fun onClosed(channel: String) {\n            println(\"closed\")\n            wsify.reconnect()\n        }\n    })\n    Thread.sleep(1000L)\n    wsify.publish(\"test\", \"114514\")\n}\n```\n\n# 开源\n\n- 本项目以[Apache-2.0](./LICENSE)许可开源, 即:\n    - 你可以直接使用该项目提供的功能, 无需任何授权\n    - 你可以在**注明来源版权信息**的情况下对源代码进行任意分发和修改以及衍生\n\n# 鸣谢\n\n\u003cdiv\u003e\n\n\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.png\" alt=\"JetBrainsIcon\" width=\"128\"\u003e\n\n\u003ca href=\"https://www.jetbrains.com/opensource/\"\u003e\u003ccode\u003eJetBrains Open Source\u003c/code\u003e\u003c/a\u003e 提供的强大IDE支持\n\n\u003c/div\u003e\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtakland%2Fkwsify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtakland%2Fkwsify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtakland%2Fkwsify/lists"}