Skip to content

📡 Network Request Inspector & Mocking

Flocon captures all outgoing network requests made by your Android or Kotlin Multiplatform app — whether they are simple REST calls or multipart uploads — and displays them in a clean, real-time desktop UI.


Overview

Network Inspector UI

Network Request Detail View

For every captured request, Flocon provides:

  • Method & URL: HTTP method (GET, POST, PUT, DELETE, etc.) and full endpoint URL
  • Headers & Body: Formatted JSON/text request and response payloads with search & copy
  • Metrics: HTTP status code, response time duration, payload size, and timestamps
  • Error Details: Clear diagnostics on connection drops, timeouts, and server errors

🎭 HTTP Request Mocking

Flocon allows you to mock HTTP requests on the fly without editing your codebase or redeploying your application:

Network Mocking in Flocon

  • Simulate Network Errors: Test 401 Unauthorized, 404 Not Found, 429 Rate Limit, or 500 Internal Server Error handling.
  • Custom Response Payloads: Inject mock JSON data to test unreleased backend features or rare edge cases.
  • Clone from Existing Request: Convert any captured real request into an active mock with a single click in the desktop UI.

Step-by-Step Mocking Tutorial


📉 Bad Network Simulation (Network Conditioning)

Flocon also includes a built-in network conditioner to simulate real-world conditions like subway network drops, slow 2G/3G speeds, high latency jitter, and random packet loss without modifying device OS settings.

Bad Network Simulation Guide


Setup & Integration

With OkHttp (Android)

[libraries]
flocon-okhttp = { module = "io.github.openflocon:flocon-okhttp-interceptor", version.ref = "flocon" }
flocon-okhttp-no-op = { module = "io.github.openflocon:flocon-okhttp-interceptor-no-op", version.ref = "flocon" }
dependencies {
    debugImplementation("io.github.openflocon:flocon-okhttp-interceptor:LAST_VERSION")
    releaseImplementation("io.github.openflocon:flocon-okhttp-interceptor-no-op:LAST_VERSION")
}

Add the interceptor to your OkHttpClient builder:

val okHttpClient = OkHttpClient.Builder()
    .addInterceptor(FloconOkhttpInterceptor())
    .build()

With Ktor (Kotlin Multiplatform)

[libraries]
flocon-ktor = { module = "io.github.openflocon:flocon-ktor-interceptor", version.ref = "flocon" }
flocon-ktor-no-op = { module = "io.github.openflocon:flocon-ktor-interceptor-no-op", version.ref = "flocon" }
kotlin {
    sourceSets {
        commonMain.dependencies {
            implementation("io.github.openflocon:flocon-ktor-interceptor:LAST_VERSION")
        }
    }
}

Install the plugin into your Ktor HttpClient:

val httpClient = HttpClient {
    install(FloconKtorPlugin)
}

Ktor Compatibility

Tested and verified with Ktor 3.x and 2.x.