I just created my code using Intellji Ktor plugin ...
# ktor
t
I just created my code using Intellji Ktor plugin and got the above error. Here's my code
Copy code
import io.ktor.application.Application
import io.ktor.client.HttpClient
import io.ktor.client.engine.apache.Apache
import io.ktor.client.request.get
import io.ktor.client.statement.HttpResponse
import kotlinx.coroutines.runBlocking
import org.apache.http.HttpHost

fun main(args: Array<String>): Unit = io.ktor.server.netty.EngineMain.main(args)

@Suppress("unused") // Referenced in application.conf
@kotlin.jvm.JvmOverloads
fun Application.module(testing: Boolean = false) {
    val client = HttpClient(Apache) {
        engine {
            /**
             * Apache embedded http redirect, default = false. Obsolete by `HttpRedirect` feature.
             * It uses the default number of redirects defined by Apache's HttpClient that is 50.
             */
            followRedirects = true

            /**
             * Timeouts.
             * Use `0` to specify infinite.
             * Negative value mean to use the system's default value.
             */

            /**
             * Max time between TCP packets - default 10 seconds.
             */
            socketTimeout = 10_000

            /**
             * Max time to establish an HTTP connection - default 10 seconds.
             */
            connectTimeout = 10_000

            /**
             * Max time for the connection manager to start a request - 20 seconds.
             */
            connectionRequestTimeout = 20_000

            customizeClient {
                // this: HttpAsyncClientBuilder
                setProxy(HttpHost("127.0.0.1", 8080))

                // Maximum number of socket connections.
                setMaxConnTotal(1000)

                // Maximum number of requests for a specific endpoint route.
                setMaxConnPerRoute(100)

                // ...
            }
            customizeRequest {
                // this: RequestConfig.Builder from Apache.
            }
        }
    }


    runBlocking {
        val resp: HttpResponse = client.get("<https://github.com/ktorio/ktor/issues>")
        print(resp.content.toString())
    }

}