https://github.com/leavesCZY/Monitor
一个适用于 OkHttp / Retrofit 的可视化抓包工具
https://github.com/leavesCZY/Monitor
network-monitoring okhttp-interceptor okttp-monitoring
Last synced: 10 months ago
JSON representation
一个适用于 OkHttp / Retrofit 的可视化抓包工具
- Host: GitHub
- URL: https://github.com/leavesCZY/Monitor
- Owner: leavesCZY
- License: apache-2.0
- Created: 2019-02-08T14:32:47.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-03-08T08:48:49.000Z (12 months ago)
- Last Synced: 2025-03-08T09:31:48.966Z (12 months ago)
- Topics: network-monitoring, okhttp-interceptor, okttp-monitoring
- Language: Kotlin
- Homepage:
- Size: 332 KB
- Stars: 297
- Watchers: 8
- Forks: 42
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Monitor [](https://central.sonatype.com/artifact/io.github.leavesczy/monitor)
一个适用于 OkHttp 和 Retrofit 的可视化抓包工具
只需为 OkHttpClient 添加 MonitorInterceptor,就会自动记录并缓存所有的网络请求信息,并提供可视化界面进行查看
```kotlin
val okHttpClient = OkHttpClient.Builder()
.addInterceptor(MonitorInterceptor())
.build()
```
同时引入 debug 和 release 版本的依赖库
- debug 依赖用于日常的开发阶段
- release 依赖用于最终的上线阶段,此模式下的 MonitorInterceptor 不包含任何依赖,也不会执行任何操作
```kotlin
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
}
}
dependencies {
val latestVersion = "x.x.x"
debugImplementation("io.github.leavesczy:monitor:${latestVersion}")
releaseImplementation("io.github.leavesczy:monitor-no-op:${latestVersion}")
}
```
