hello. i am trying to use the ktor lib in order to...
# android
v
hello. i am trying to use the ktor lib in order to perform some cloud requests. if i have a vpn connection ON on the device, the requests get timeout (even if the timeout is set to 30 seconds). i will leave in the thread how chatGPT suggested to configure the HttpClient I use in order to avoid the problem, but I still encounter it has anyone encountered this issue?
Copy code
HttpClient(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)
        }
    }
}
t
probably a firewall rule blocking your request not anything in your client config