{"id":18655234,"url":"https://github.com/ibrahimsn98/achilles","last_synced_at":"2025-06-26T02:36:59.185Z","repository":{"id":86778854,"uuid":"246385989","full_name":"ibrahimsn98/achilles","owner":"ibrahimsn98","description":"A Simple Retrofit Inspired Android Websocket Client (In Development)","archived":false,"fork":false,"pushed_at":"2021-03-29T19:37:14.000Z","size":204,"stargazers_count":44,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T20:43:53.719Z","etag":null,"topics":["android-library","android-retrofit","android-websocket-client","android-websocketclient","websocket-client","websockets"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/ibrahimsn98.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,"zenodo":null}},"created_at":"2020-03-10T19:10:28.000Z","updated_at":"2024-12-29T15:26:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"acc6270f-c283-4837-8dda-5e927d39f996","html_url":"https://github.com/ibrahimsn98/achilles","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ibrahimsn98/achilles","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimsn98%2Fachilles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimsn98%2Fachilles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimsn98%2Fachilles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimsn98%2Fachilles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ibrahimsn98","download_url":"https://codeload.github.com/ibrahimsn98/achilles/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ibrahimsn98%2Fachilles/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261987780,"owners_count":23240911,"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":["android-library","android-retrofit","android-websocket-client","android-websocketclient","websocket-client","websockets"],"created_at":"2024-11-07T07:18:11.402Z","updated_at":"2025-06-26T02:36:59.176Z","avatar_url":"https://github.com/ibrahimsn98.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Achilles\n\nA Simple Retrofit, Scarlet Inspired Android Websocket Client\n\n[![](https://jitpack.io/v/ibrahimsn98/achilles.svg)](https://jitpack.io/#ibrahimsn98/achilles)\n[![API](https://img.shields.io/badge/API-22%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=22)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Achilles-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/8054)\n![Android CI](https://github.com/ibrahimsn98/achilles/workflows/Android%20CI/badge.svg?branch=master\u0026event=push)\n\n## Motivation\nI have created this library to communicate the apps with their own backends. All receiver and send methods require to specify event name, so both client and server applications distinguish the right payload.\n\n\n## Payload\n-   Data sent\n```\n{\"event\": \"echo\", \"data\": {\"name\": \"Mark\", \"surname\": \"Bond\"}}\n```\n-   Data sent (Encoded payload)\n```\n{\"event\": \"echo\", \"data\": \"eyJuYW1lIjogIk1hcmsiLCAic3VybmFtZSI6ICJCb25kIn0=\"}\n```\n-   Data received\n```\n{\"event\": \"echo\", \"data\": {\"name\": \"Mark\", \"surname\": \"Bond\"}}\n```\n\n\n## Usage\n-   Create service interface\n```kotlin\ninterface SocketService {\n\n    @SendEvent(\"echo\")\n    fun sendEcho(\n        @Field(\"name\") name: String,\n        @Field(\"surname\") surname: String\n    )\n\n    @ReceiveEvent(\"echo\")\n    suspend fun receiveEcho(): Flow\u003cResponse\u003e\n}\n```\n\n-   Use Achilles to create an implementation:\n```kotlin\nval achilles = Achilles.Builder()\n    .baseUrl(\"wss://echo.websocket.org\")\n    .client(OkHttpClient().newBuilder().build())\n    .encodePayload(true)\n    .logTraffic(true)\n    .build()\n\nval service = achilles.create(SocketService::class.java)\n```\n\n-   Send and observe socket event data\n```kotlin\nCoroutineScope(IO).launch {\n    service.receiveEcho().onEach {\n        Log.d(\"MainActivity\", \"Response: $it\")\n    }\n\n    service.sendEcho(\"Name\", \"Surname\")\n}\n```\n\n\n## Setup\n```gradle\nallprojects {\n\trepositories {\n\t\t...\n\t\tmaven { url 'https://jitpack.io' }\n\t}\n}\n\ndependencies {\n    implementation 'com.github.ibrahimsn98:achilles:1.4'\n}\n```\n\n\n## TODO\n- [ ] Lifecycle aware connection\n- [ ] Reconnect on disconnection\n- [ ] Socket status events\n- [ ] Payload encryption\n\n\n## License\n```\nMIT License\n\nCopyright (c) 2019 İbrahim Süren\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimsn98%2Fachilles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibrahimsn98%2Fachilles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibrahimsn98%2Fachilles/lists"}