{"id":13536659,"url":"https://github.com/05nelsonm/kmp-tor","last_synced_at":"2025-10-13T06:09:05.836Z","repository":{"id":37024230,"uuid":"456238754","full_name":"05nelsonm/kmp-tor","owner":"05nelsonm","description":"Kotlin Multiplatform Library for embedding Tor into your application","archived":false,"fork":false,"pushed_at":"2025-03-03T06:50:26.000Z","size":20472,"stargazers_count":42,"open_issues_count":21,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-08T09:14:32.861Z","etag":null,"topics":["android","android-lib","android-libraries","android-library","android-libs","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-multiplatform-library","kotlin-multiplatform-mobile","tor"],"latest_commit_sha":null,"homepage":"https://kmp-tor.matthewnelson.io/","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/05nelsonm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2022-02-06T18:38:56.000Z","updated_at":"2025-03-03T23:05:00.000Z","dependencies_parsed_at":"2023-02-17T00:45:34.735Z","dependency_job_id":"472c72ef-7b54-4a9b-beac-a502057d6a3a","html_url":"https://github.com/05nelsonm/kmp-tor","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05nelsonm%2Fkmp-tor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05nelsonm%2Fkmp-tor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05nelsonm%2Fkmp-tor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/05nelsonm%2Fkmp-tor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/05nelsonm","download_url":"https://codeload.github.com/05nelsonm/kmp-tor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246922247,"owners_count":20855345,"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","android-lib","android-libraries","android-library","android-libs","kotlin","kotlin-android","kotlin-library","kotlin-multiplatform","kotlin-multiplatform-library","kotlin-multiplatform-mobile","tor"],"created_at":"2024-08-01T09:00:46.601Z","updated_at":"2025-10-13T06:09:05.798Z","avatar_url":"https://github.com/05nelsonm.png","language":"Kotlin","funding_links":[],"categories":["Libraries"],"sub_categories":["Network"],"readme":"# kmp-tor\n[![badge-license]][url-license]\n[![badge-latest-release]][url-latest-release]\n\n[![badge-kotlin]][url-kotlin]\n[![badge-coroutines]][url-coroutines]\n[![badge-encoding]][url-encoding]\n[![badge-immutable]][url-immutable]\n[![badge-kmp-process]][url-kmp-process]\n[![badge-kmp-tor-common]][url-kmp-tor-common]\n[![badge-kotlincrypto-bitops]][url-kotlincrypto-bitops]\n[![badge-kotlincrypto-hash]][url-kotlincrypto-hash]\n[![badge-kotlincrypto-random]][url-kotlincrypto-random]\n[![badge-androidx-startup]][url-androidx-startup]\n\n![badge-platform-android]\n![badge-platform-jvm]\n![badge-platform-js-node]\n![badge-platform-wasm]\n![badge-platform-linux]\n![badge-platform-ios]\n![badge-platform-macos]\n![badge-support-android-native]\n![badge-support-linux-arm]\n\nKotlin Multiplatform support for embedding Tor into your application.\n\n```kotlin\nval runtime = TorRuntime.Builder(myEnvironment) {\n    RuntimeEvent.entries().forEach { event -\u003e\n        observerStatic(event, OnEvent.Executor.Immediate) { data -\u003e\n            println(data.toString())\n        }\n    }\n    TorEvent.entries().forEach { event -\u003e\n        observerStatic(event, OnEvent.Executor.Immediate) { data -\u003e\n            println(data)\n        }\n    }\n    config { environment -\u003e\n        TorOption.SocksPort.configure { auto() }\n        // ...\n    }\n    required(TorEvent.ERR)\n    required(TorEvent.WARN)\n}\n```\n\n```kotlin\n// Asynchronous APIs\nmyScope.launch {\n    runtime.startDaemonAsync()\n    runtime.restartDaemonAsync()\n    runtime.executeAsync(TorCmd.Signal.NewNym)\n    runtime.stopDaemonAsync()\n}\n```\n\n```kotlin\n// Synchronous APIs (Android/Jvm/Native)\nruntime.startDaemonSync()\nruntime.restartDaemonSync()\nruntime.executeSync(TorCmd.Signal.NewNym)\nruntime.stopDaemonSync()\n```\n\n```kotlin\n// Callback APIs\nruntime.enqueue(\n    Action.StartDaemon,\n    OnFailure.noOp(),\n    OnSuccess {\n        runtime.enqueue(\n            Action.RestartDaemon,\n            OnFailure.noOp(),\n            OnSuccess {\n                runtime.enqueue(\n                    TorCmd.Signal.NewNym,\n                    OnFailure.noOp(),\n                    OnSuccess {\n                        runtime.enqueue(\n                            Action.StopDaemon,\n                            OnFailure.noOp(),\n                            OnSuccess.noOp(),\n                        )  \n                    },\n                )\n            },\n        )\n    },\n)\n```\n\n### Get Started\n\n\u003c!-- TAG_VERSION --\u003e\n\n- Add runtime dependency\n  ```kotlin\n  dependencies {\n      implementation(\"io.matthewnelson.kmp-tor:runtime:2.5.0\")\n  }\n  ```\n\n- If using Java9+, ensure you have defined module `java.management` for your application.\n\n- For Java or Android, see the `NOTE` for [OnEvent.Executor.Main][url-executor-main] for when the \n  `kotlinx-coroutines-{android/javafx/swing}` UI dependency is needed.\n\n- Configure tor resources\n    - See [kmp-tor-resource#Get Started][url-kmp-tor-resource-start]\n\n- Configure optional service dependency\n    - See [runtime-service][docs-runtime-service]\n\n- Refer to the API docs\n    - See [https://kmp-tor.matthewnelson.io][docs-root]\n\n### Samples\n\nSee [kmp-tor-samples][url-kmp-tor-samples]\n\n\u003c!-- TAG_VERSION --\u003e\n[badge-latest-release]: https://img.shields.io/badge/latest--release-2.5.0-5d2f68.svg?logo=torproject\u0026style=flat\u0026logoColor=5d2f68\n[badge-license]: https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat\n\n\u003c!-- TAG_DEPENDENCIES --\u003e\n[badge-androidx-startup]: https://img.shields.io/badge/androidx.startup-1.1.1-6EDB8D.svg?logo=android\n[badge-coroutines]: https://img.shields.io/badge/kotlinx.coroutines-1.10.2-blue.svg?logo=kotlin\n[badge-encoding]: https://img.shields.io/badge/encoding-2.5.0-blue.svg?style=flat\n[badge-immutable]: https://img.shields.io/badge/immutable-0.3.0-blue.svg?style=flat\n[badge-kmp-process]: https://img.shields.io/badge/kmp--process-0.4.0-blue.svg?style=flat\n[badge-kmp-tor-common]: https://img.shields.io/badge/kmp--tor--common-2.4.0-blue.svg?style=flat\n[badge-kotlin]: https://img.shields.io/badge/kotlin-2.2.20-blue.svg?logo=kotlin\n[badge-kotlincrypto-bitops]: https://img.shields.io/badge/kotlincrypto.bitops-0.3.0-blue.svg?style=flat\n[badge-kotlincrypto-hash]: https://img.shields.io/badge/kotlincrypto.hash-0.8.0-blue.svg?style=flat\n[badge-kotlincrypto-random]: https://img.shields.io/badge/kotlincrypto.random-0.6.0-blue.svg?style=flat\n\n\u003c!-- TAG_PLATFORMS --\u003e\n[badge-platform-android]: https://img.shields.io/badge/-android-6EDB8D.svg?style=flat\n[badge-platform-jvm]: https://img.shields.io/badge/-jvm-DB413D.svg?style=flat\n[badge-platform-js]: https://img.shields.io/badge/-js-F8DB5D.svg?style=flat\n[badge-platform-js-node]: https://img.shields.io/badge/-nodejs-68a063.svg?style=flat\n[badge-platform-linux]: https://img.shields.io/badge/-linux-2D3F6C.svg?style=flat\n[badge-platform-macos]: https://img.shields.io/badge/-macos-111111.svg?style=flat\n[badge-platform-ios]: https://img.shields.io/badge/-ios-CDCDCD.svg?style=flat\n[badge-platform-tvos]: https://img.shields.io/badge/-tvos-808080.svg?style=flat\n[badge-platform-watchos]: https://img.shields.io/badge/-watchos-C0C0C0.svg?style=flat\n[badge-platform-wasm]: https://img.shields.io/badge/-wasm-624FE8.svg?style=flat\n[badge-platform-windows]: https://img.shields.io/badge/-windows-4D76CD.svg?style=flat\n[badge-support-android-native]: https://img.shields.io/badge/support-[AndroidNative]-6EDB8D.svg?style=flat\n[badge-support-linux-arm]: https://img.shields.io/badge/support-[LinuxArm]-2D3F6C.svg?style=flat\n\n[docs-root]: https://kmp-tor.matthewnelson.io\n[docs-runtime-service]: https://kmp-tor.matthewnelson.io/library/runtime-service/index.html\n\n[url-latest-release]: https://github.com/05nelsonm/kmp-tor/releases/latest\n[url-license]: https://www.apache.org/licenses/LICENSE-2.0\n[url-androidx-startup]: https://developer.android.com/jetpack/androidx/releases/startup\n[url-coroutines]: https://github.com/Kotlin/kotlinx.coroutines\n[url-encoding]: https://github.com/05nelsonm/encoding\n[url-immutable]: https://github.com/05nelsonm/immutable\n[url-kmp-process]: https://github.com/05nelsonm/kmp-process\n[url-kmp-tor-common]: https://github.com/05nelsonm/kmp-tor-common\n[url-kmp-tor-samples]: https://github.com/05nelsonm/kmp-tor-samples\n[url-kmp-tor-resource-start]: https://github.com/05nelsonm/kmp-tor-resource?tab=readme-ov-file#get-started\n[url-kotlin]: https://kotlinlang.org\n[url-kotlincrypto-bitops]: https://github.com/KotlinCrypto/bitops\n[url-kotlincrypto-hash]: https://github.com/KotlinCrypto/hash\n[url-kotlincrypto-random]: https://github.com/KotlinCrypto/random\n[url-executor-main]: https://kmp-tor.matthewnelson.io/library/runtime-core/io.matthewnelson.kmp.tor.runtime.core/-on-event/-executor/-main/index.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05nelsonm%2Fkmp-tor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F05nelsonm%2Fkmp-tor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F05nelsonm%2Fkmp-tor/lists"}