:ktormonitor: KtorMonitor 1.11.2 is out! :rocket:...
# feed
c
ktormonitor KtorMonitor 1.11.2 is out! 🚀 New Feature: OkHttp Network Monitoring Real-time network monitoring for OkHttp is now available for Android and JVM! Slack: #C0AB9GA32H0 Github: https://github.com/CosminMihuMDC/KtorMonitor 🔍 What it does: • 🌐Ktor Network Monitoring: Real-time interception and logging of Ktor Client traffic. • 🌐OkHttp Network Monitoring: Real-time interception and logging of OkHttp traffic. • 📱Kotlin Multiplatform (KMP): Full support for Android, iOS, Desktop (JVM), Wasm, and JS. • 🛠️Highly Configurable: Customize retention periods, content length limits, and notification behavior. • 🔒Security First: Redact sensitive headers (e.g., Authorization). • 📂Data Export: Save request/response details to local files for easier debugging or sharing. • 🎨Rich Previews: Built-in viewers for JSON, XML, HTML, CSS, Form Data, Image (JPG, PNG, SVG, GIF, WEBP). • 📡SSE & WebSockets: Track one-way streams (SSE) and bidirectional traffic (WebSockets). • 🛡️Production Safe: No-Op version to ensure monitoring code is excluded from your production builds. G Setup
Copy code
dependencies {
    debugImplementation("`ro.cosminmihu.ktor:ktor-monitor-okhttp-interceptor:1.11.2")
    releaseImplementation("ro.cosminmihu.ktor:ktor-monitor-okhttp-interceptor-no-op:1.11.2")
}
🔲 Install
Copy code
OkHttpClient.Builder()
    .addNetworkInterceptor(
        KtorMonitorInterceptor {
            sanitizeHeader { header -> header == "Authorization" }
            filter { request -> !request.url.host.contains("<http://cosminmihu.ro|cosminmihu.ro>") }
            showNotification = true
            retentionPeriod = RetentionPeriod.OneHour
            maxContentLength = ContentLength.Default
        }
    )
    .build()
👍 1