
Intercept HTTP and WebSocket traffic, mock API responses, throttle requests, and capture detailed logs; includes built-in inspector UI, header masking, log retention, and no-op release variants.
Kotlin Multiplatform network inspection and mocking SDK. Intercept HTTP and WebSocket traffic, mock API responses, and throttle requests — no proxy server needed.
| Client | Android | iOS | JVM Desktop |
|---|---|---|---|
| Ktor | ✅ | ✅ | ✅ |
| OkHttp | ✅ | — | ✅ |
| Client | iOS |
|---|---|
| URLSession | ✅ |
wiretap-urlsession is a dedicated Swift wrapper exported as an XCFramework via KMMBridge/SPM.
WiretapKMP is published to Maven Central.
In your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}dependencies {
// Debug
debugImplementation("dev.skymansandy:wiretap-ktor:1.0.0-RC3")
// Release (no-op)
releaseImplementation("dev.skymansandy:wiretap-ktor-noop:1.0.0-RC3")
}dependencies {
// Debug
debugImplementation("dev.skymansandy:wiretap-okhttp:1.0.0-RC3")
// Release (no-op)
releaseImplementation("dev.skymansandy:wiretap-okhttp-noop:1.0.0-RC3")
}Add the WiretapURLSession SPM package, then use #if DEBUG to disable in release:
#if DEBUG
let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = true
}
#else
let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = false
}
#endifval client = HttpClient {
install(WiretapKtorPlugin) {
enabled = true
logRetention = LogRetention.Days(7)
}
install(WiretapKtorWebSocketPlugin)
}val client = OkHttpClient.Builder()
.addInterceptor(
WiretapOkHttpInterceptor {
enabled = true
logRetention = LogRetention.Days(7)
}
)
.build()let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = true
config.logRetention = LogRetention.Days(days: 7)
}
interceptor.intercept(request: request) { data, response, error in
// handle response
}Swap dependencies for release builds — no conditional code needed.
| Debug | Release |
|---|---|
wiretap-ktor |
wiretap-ktor-noop |
wiretap-okhttp |
wiretap-okhttp-noop |
For URLSession, use config.enabled = false with #if DEBUG (see installation above).
Copyright 2025 skymansandy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Kotlin Multiplatform network inspection and mocking SDK. Intercept HTTP and WebSocket traffic, mock API responses, and throttle requests — no proxy server needed.
| Client | Android | iOS | JVM Desktop |
|---|---|---|---|
| Ktor | ✅ | ✅ | ✅ |
| OkHttp | ✅ | — | ✅ |
| Client | iOS |
|---|---|
| URLSession | ✅ |
wiretap-urlsession is a dedicated Swift wrapper exported as an XCFramework via KMMBridge/SPM.
WiretapKMP is published to Maven Central.
In your settings.gradle.kts:
dependencyResolutionManagement {
repositories {
mavenCentral()
google()
}
}dependencies {
// Debug
debugImplementation("dev.skymansandy:wiretap-ktor:1.0.0-RC3")
// Release (no-op)
releaseImplementation("dev.skymansandy:wiretap-ktor-noop:1.0.0-RC3")
}dependencies {
// Debug
debugImplementation("dev.skymansandy:wiretap-okhttp:1.0.0-RC3")
// Release (no-op)
releaseImplementation("dev.skymansandy:wiretap-okhttp-noop:1.0.0-RC3")
}Add the WiretapURLSession SPM package, then use #if DEBUG to disable in release:
#if DEBUG
let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = true
}
#else
let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = false
}
#endifval client = HttpClient {
install(WiretapKtorPlugin) {
enabled = true
logRetention = LogRetention.Days(7)
}
install(WiretapKtorWebSocketPlugin)
}val client = OkHttpClient.Builder()
.addInterceptor(
WiretapOkHttpInterceptor {
enabled = true
logRetention = LogRetention.Days(7)
}
)
.build()let interceptor = WiretapURLSessionInterceptor(session: .shared) { config in
config.enabled = true
config.logRetention = LogRetention.Days(days: 7)
}
interceptor.intercept(request: request) { data, response, error in
// handle response
}Swap dependencies for release builds — no conditional code needed.
| Debug | Release |
|---|---|
wiretap-ktor |
wiretap-ktor-noop |
wiretap-okhttp |
wiretap-okhttp-noop |
For URLSession, use config.enabled = false with #if DEBUG (see installation above).
Copyright 2025 skymansandy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.