Hello,
I didn't find anywhere information regarding the possibility of making ktor-client requests using proxy with authentication.
Is it possible at all?
I've found that it can be done with Apache client:
private val client = io.ktor.client.HttpClient(Apache) {
engine {
followRedirects = true
customizeClient {
setProxy(HttpHost(proxyDetails.host, proxyDetails.port))
val credentialsProvider = BasicCredentialsProvider()
credentialsProvider .setCredentials(AuthScope(proxyHost, proxyPort),
UsernamePasswordCredentials(proxyUsername, proxyPassword))
setDefaultCredentialsProvider(credentialsProvider )
}
}
}
Is there a way to do it multiplatform ?
Most helpful comment
I've found that it can be done with Apache client: