A Kotlin-Multiplatform (KMP)1 Ktor client engine that binds to the rquest
(aka. reqwest-impersonate) Rust crate, allowing configuring the TLS ClientHello
and HTTP/2 options
at a low level.
This allows impersonating browsers and other HTTP clients with ease, and spoofing JA3/JA4/Akamai HTTP/2 fingerprints. Presets are provided for convenience of Chrome, Safari, Edge, and OkHTTP.
1:
Currently only Android (x86, x86_64, armeabi-v7a, arm64-v8a) is supported.
More platforms, including JVM, Desktop native, and iOS, will be supported at a later date.
build.gradle.kts
:
val version = "1.0.0"
// Without KMP
dependencies {
implementation("dev.rushii.ktor-impersonate:ktor-impersonate:$version")
}
// KMP
kotlin {
sourceSets {
commonMain.dependencies {
implementation("dev.rushii.ktor-impersonate:ktor-impersonate:$version")
}
}
}
Quick start:
import dev.rushii.ktor_impersonate.*
import io.ktor.client.*
import io.ktor.client.request.*
val client = HttpClient(Impersonate) {
engine {
preset = ImpersonatePreset.Chrome129
}
}
client.get("https://google.com")