Update OkHttp and configure async DNS
This commit is contained in:
1 parent
c6b6d9a310
commit
ebce847724
3 files changed
+19
-1
No files matched your search
@@ -225,6 +225,10 @@ dependencies {
|
||||
|
||||
implementation(libs.bundles.splitties)
|
||||
|
||||
// https://square.github.io/okhttp/changelogs/changelog/
|
||||
implementation(platform(libs.okhttp.bom))
|
||||
implementation(libs.okhttp.android)
|
||||
|
||||
implementation(libs.okio.jvm)
|
||||
|
||||
implementation(libs.logcat)
|
||||
|
||||
@@ -1,5 +1,16 @@
|
||||
package com.hippo.ehviewer.ktor
|
||||
|
||||
import com.hippo.ehviewer.util.isAtLeastQ
|
||||
import io.ktor.client.engine.okhttp.OkHttpConfig
|
||||
import okhttp3.AsyncDns
|
||||
import okhttp3.ExperimentalOkHttpApi
|
||||
import okhttp3.android.AndroidAsyncDns
|
||||
|
||||
fun OkHttpConfig.configureClient() = Unit
|
||||
@OptIn(ExperimentalOkHttpApi::class)
|
||||
fun OkHttpConfig.configureClient() {
|
||||
config {
|
||||
if (isAtLeastQ) {
|
||||
dns(AsyncDns.toDns(AndroidAsyncDns.IPv4, AndroidAsyncDns.IPv6))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@ kotlinx-datetime = "0.6.1"
|
||||
kotlinx-serialization = "1.7.3"
|
||||
ksp = "2.1.0-Beta2-1.0.25"
|
||||
ktor = "3.0.0"
|
||||
okhttp = "5.0.0-alpha.14"
|
||||
okio = "3.9.1"
|
||||
splitties = "3.0.0"
|
||||
telephoto = "0.13.0"
|
||||
@@ -91,6 +92,8 @@ kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.
|
||||
|
||||
ktlint = "com.pinterest:ktlint:1.4.0-kotlin-dev-SNAPSHOT"
|
||||
|
||||
okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
|
||||
okhttp-android = { module = "com.squareup.okhttp3:okhttp-android" }
|
||||
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
|
||||
|
||||
logcat = "com.squareup.logcat:logcat:0.1"
|
||||
|
||||
Reference in new issue
Block a user