{"id":28932917,"url":"https://github.com/adibfara/watchtower","last_synced_at":"2025-09-11T05:33:10.771Z","repository":{"id":107363071,"uuid":"163415197","full_name":"adibfara/WatchTower","owner":"adibfara","description":"🗼Observe OKHttp API Calls With Request And Response Details Right In Your Browser!","archived":false,"fork":false,"pushed_at":"2021-04-15T18:48:28.000Z","size":2134,"stargazers_count":315,"open_issues_count":5,"forks_count":19,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-26T06:32:21.742Z","etag":null,"topics":["android","kotlin","networking","okhttp","retrofit2"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adibfara.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-12-28T13:46:59.000Z","updated_at":"2025-07-19T06:18:07.000Z","dependencies_parsed_at":"2023-03-25T22:02:34.840Z","dependency_job_id":null,"html_url":"https://github.com/adibfara/WatchTower","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/adibfara/WatchTower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibfara%2FWatchTower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibfara%2FWatchTower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibfara%2FWatchTower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibfara%2FWatchTower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adibfara","download_url":"https://codeload.github.com/adibfara/WatchTower/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adibfara%2FWatchTower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274583502,"owners_count":25311856,"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-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","kotlin","networking","okhttp","retrofit2"],"created_at":"2025-06-22T17:09:26.401Z","updated_at":"2025-09-11T05:33:10.766Z","avatar_url":"https://github.com/adibfara.png","language":"Kotlin","readme":"WatchTower - Observe OKHttp API Calls With Request And Response Details Right In Your Browser!\n----------------------------------------------------------------------------------------------\n[![Build Status](https://travis-ci.org/adibfara/Watchtower.svg?branch=master)](https://travis-ci.org/adibfara/Watchtower) [ ![Download](https://api.bintray.com/packages/adibfara/WatchTower/WatchTower/images/download.svg) ](https://bintray.com/adibfara/WatchTower/WatchTower/)\n\n![Screenshot](https://raw.githubusercontent.com/adibfara/Watchtower/master/screenshots/screenshot-1.jpg \"Watchtower Screenshot\")\n\n\nDownload\n--------\nAdd the dependencies to your project:\n\n```groovy\ndebugImplementation 'com.snakyapps.watchtower:interceptor-okhttp:2.0.2'\nreleaseImplementation 'com.snakyapps.watchtower:interceptor-okhttp-no-op:2.0.2' // no-op dependency for non-debug build variants\n```\n\nSetup\n-----\n**Add the interceptor to your OKHttp Client**\n```kotlin\n        val retrofit = Retrofit.Builder()\n                        .client(\n                            OkHttpClient.Builder()\n                            .addInterceptor(WatchTowerInterceptor())\n                            .build()\n                        )\n                        // ...\n                .build()\n\n        WatchTower.start(WebWatchTowerObserver(port = 8085)) // in Application class\n```\n\n**(Optional for Android) Add the Android artifact**\n\n![Android Artifact](https://raw.githubusercontent.com/adibfara/Watchtower/master/screenshots/android.png \"Android Screenshot\")\n\nYou can add the following artifact to see the requests right in your notification area. You can `collect` from a `Flow\u003cNotification\u003e` and notify the notification manager.\n\n```groovy\ndebugImplementation 'com.snakyapps.watchtower:android:2.0.2'\nreleaseImplementation 'com.snakyapps.watchtower:android-no-op:2.0.2' // no-op dependency for non-debug build variants\n```\n\n```kotlin\n   someScope.launch {\n                WatchTowerAndroid.notificationFlow(application, serverPort).collect {\n                    notification -\u003e\n                    (getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager).notify(999991, notification.build())\n                }\n            }\n\n```\n\nTo turn off notifications, you can cancel the coroutine `Job` (e.g. `launch`).\n\nFeatures\n--------\n![Video](https://raw.githubusercontent.com/adibfara/WatchTower/master/screenshots/video.gif \"Watchtower Video\")\n\n- Track and observe all API calls made through OKHttp's client\n- GET, POST, PUT, DELETE, PATCH methods\n- Query parameters, request and response body and headers\n- Response success and failure status, size, date and latency\n- Adjustable port for the server and the websocket server\n- API call history, even If no browsers were open\n- Search in the URLs of all requests\n- Fully responsive UI\n- Fully extensible\n\n\n**Observing the events using your browser**\nConnect the device that is running the app to the same network that you want to observe the data. If you are on a WiFi, both devices should be connected to the same WiFi so they can communicate with each other.\nAfter running your application, you can navigate to `http://yourip:8085/` and view the network calls. If you don't know what `yourip` is, It will be printed out to the console with the message of `WatchTower started, listening on ... `  when `Watchtower.start()` is called.\n\n**Observing emulator events in your computers browser**\nIf your running WatchTower in an emulator you need to forward both server and websocket ports from the emulator to your local computer. For example if WatchTower is running on port `8085` you would need to run:\n```\nadb forward tcp:8085 tcp:8085\nadb forward tcp:5003 tcp:5003\n```\nThe forward of port 5003 is used for the websocket connection.\n\n#### Notes\nPRs are more than welcome, and please file an issue If you encounter something 🍻.\n\nYou can also ping me on twitter [@TheSNAKY](http://twitter.com/TheSNAKY).\n\n\nLicense\n=======\n\n    Copyright 2019 Adib Faramarzi.\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","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadibfara%2Fwatchtower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadibfara%2Fwatchtower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadibfara%2Fwatchtower/lists"}