WiretapKMP is a drop-in network inspector and mocker for Kotlin Multiplatform apps. Add one dependency, install the plugin, and inspect every HTTP request, WebSocket message, and SSE event — or mock and throttle them — all from a built-in UI. No proxy needed.
Early Preview — We're looking for early adopters and feedback! Open an issue or start a discussion.
// Ktor
val client = HttpClient {
install(WiretapKtorHttpPlugin)
}
// OkHttp
val client = OkHttpClient.Builder()
.addInterceptor(WiretapOkHttpInterceptor())
.build()That's it. Open your app and shake the device (or press Ctrl+Shift+D on desktop) to launch the inspector.
| HTTP | WebSocket | SSE | |
|---|---|---|---|
| Ktor | ✅ | ✅ | ✅ |
| OkHttp | ✅ | ✅ | ✅ |
| URLSession | ✅ | — | — |
| Android | iOS | JVM Desktop | |
|---|---|---|---|
| Ktor | ✅ | ✅ | ✅ |
| OkHttp | ✅ | — | ✅ |
| URLSession | — | ✅ | — |
| Overview | Request | Response |
|---|---|---|
![]() |
![]() |
![]() |
| WebSocket | Messages | Notifications |
|---|---|---|
![]() |
![]() |
![]() |
- Zero-config logging — install the plugin and all traffic is captured automatically
- API mocking — return fake responses without hitting the network. Match on method, URL, headers, and body
- Request throttling — simulate slow connections with fixed or random delays
- Header masking — redact
Authorization,Cookie, or any sensitive header from logs - Shake to launch — built-in gesture to open the inspector (no UI code required)
- No-op variants — swap to
wiretap-ktor-noop/wiretap-okhttp-noopfor release builds with zero overhead - Share as file — export any log entry via the platform share sheet
WiretapKMP can inspect Server-Sent Events (SSE) streams — log every connection, event, and status change right alongside your HTTP and WebSocket traffic.
⚠️ SSE inspection is in early preview. APIs are marked with@ExperimentalWiretapSseApiand may change in future releases.
Install the SSE plugin and wrap your session:
@OptIn(ExperimentalWiretapSseApi::class)
val client = HttpClient {
install(SSE)
install(WiretapKtorSsePlugin) // SSE logging
install(WiretapKtorHttpPlugin) // HTTP logging
}
client.sse("https://api.example.com/stream") {
val session = this.wiretapped()
session.incoming.collect { event ->
println("Event: ${event.event} — ${event.data}")
}
}Wrap your EventSourceListener with .wiretapped():
val client = OkHttpClient.Builder()
.addInterceptor(WiretapOkHttpInterceptor())
.build()
val request = Request.Builder().url("https://api.example.com/stream").build()
val factory = EventSources.createFactory(client)
@OptIn(ExperimentalWiretapSseApi::class)
factory.newEventSource(request, myListener.wiretapped())| Connection | Events |
|---|---|
| URL, headers, status (Open → Closed/Failed), timestamps | Event type, data payload, event ID, byte count, timestamp |
For full details, see the Ktor SSE guide and OkHttp SSE guide.
// build.gradle.kts
debugImplementation("dev.skymansandy:wiretap-ktor:1.0.0-RC10")
releaseImplementation("dev.skymansandy:wiretap-ktor-noop:1.0.0-RC10")
// or for OkHttp
debugImplementation("dev.skymansandy:wiretap-okhttp:1.0.0-RC10")
releaseImplementation("dev.skymansandy:wiretap-okhttp-noop:1.0.0-RC10")For full setup including URLSession and advanced configuration, see the Getting Started guide.
Full docs · Getting Started · API Reference
Contributions are welcome! Fork the repo, create a feature branch, and open a PR.
Kotlin Multiplatform · Compose Multiplatform · Ktor · Room · Koin · OkHttp · SKIE · KMMBridge










