Vlad Ghilicica
11/03/2025, 4:02 PMVlad Ghilicica
11/03/2025, 4:02 PMHttpClient(OkHttp) {
engine {
config {
// Use system DNS resolver instead of OkHttp's cached DNS
dns { hostname -> InetAddress.getAllByName(hostname).toList() }
// Reduce connection pool keep-alive time to handle VPN switches better
connectionPool(
ConnectionPool(
maxIdleConnections = 5,
keepAliveDuration = 30,
timeUnit = TimeUnit.SECONDS
)
)
// Force connection retry on connection failure
retryOnConnectionFailure(true)
}
}
}Chrimaeon
11/03/2025, 7:27 PMVlad Ghilicica
11/04/2025, 8:07 AMChrimaeon
11/04/2025, 1:43 PM