Files
llm-proxy/src/linuxX64Main/kotlin/pw/binom/llmproxy/Platform.kt
T
2026-08-30 14:06:35 +03:00

20 lines
552 B
Kotlin

package pw.binom.llmproxy
import io.ktor.client.HttpClient
import io.ktor.client.engine.cio.CIO
import io.ktor.server.application.Application
import io.ktor.server.cio.CIO as ServerCIO
import io.ktor.server.engine.embeddedServer
actual fun createHttpClient(): HttpClient = HttpClient(CIO) {
engine {
requestTimeout = UPSTREAM_REQUEST_TIMEOUT_MS
}
}
actual fun startServer(host: String, port: Int, module: Application.() -> Unit) {
embeddedServer(ServerCIO, port = port, host = host) {
module()
}.start(wait = true)
}