Skip to content

Commit

Permalink
Switch to OkHttp as http client on jvm
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Mar 20, 2024
1 parent 0b3848c commit 0053079
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kotlin {
}
jvmMain {
dependencies {
api(libs.ktor.client.cio)
api(libs.ktor.client.okhttp)
}
}
nonJvmMain {
Expand Down
4 changes: 2 additions & 2 deletions common/src/jvmMain/kotlin/http/HttpEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package dev.kord.common.http

import dev.kord.common.annotation.KordInternal
import io.ktor.client.engine.*
import io.ktor.client.engine.cio.*
import io.ktor.client.engine.okhttp.OkHttp

/** @suppress */
@KordInternal
public actual fun httpEngine(): HttpClientEngineFactory<HttpClientEngineConfig> = CIO
public actual fun httpEngine(): HttpClientEngineFactory<HttpClientEngineConfig> = OkHttp
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ktor-client-js = { module = "io.ktor:ktor-client-js", version.ref = "ktor" }
ktor-client-winhttp = { module = "io.ktor:ktor-client-winhttp", version.ref = "ktor" }
ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" }
ktor-client-curl = { module = "io.ktor:ktor-client-curl", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-client-okhttp = { module = "io.ktor:ktor-client-okhttp", version.ref = "ktor" }
ktor-client-websockets = { module = "io.ktor:ktor-client-websockets", version.ref = "ktor" }
ktor-client-mock = { module = "io.ktor:ktor-client-mock", version.ref = "ktor" }
ktor-network = { module = "io.ktor:ktor-network", version.ref = "ktor" }
Expand Down

0 comments on commit 0053079

Please sign in to comment.