NetworkClassifier

fun interface NetworkClassifier

Classifies a request URL into zero or more category labels.

A host-supplied SPI for tagging captured traffic with category labels, so apps can classify requests, such as "Sync" or "Media", however they like. The Network tab gives Sync, Auth, Media, Config, AI, and Wiretap a color each, case-sensitive, and every other label one gray. Use NoOpNetworkClassifier for the default behaviour of no categories.

Called on the same threads as Redactor: a background capture thread, or the app's HTTP threads when capture falls behind. Keep it thread-safe.

Functions

Link copied to clipboard
abstract fun classify(url: String): List<String>

Returns the category labels for url; may be empty.