Im using Retrofit2 in my Android project and configure it's okhttp3 client with the netcipher library's StrongOkHttpClientBuilder to use the local HTTP proxy (127.0.0.1:8118) provided by the Orbot application in the background.
For testing purpose, I create for every request a new Retrofit2 client (with new Okhttp3 client) and send a request to http://api.ipify.org/ to verify the current public IP. Everything is working fine, the connection goes through the local Tor proxy and the public IP I get as response from ipify.org is an IP from the Tor network.
BUT: When I change the circuit in Orbot manually, so that the local proxy resolves to a different Tor-network IP and test again, the oldTor-network IP gets used... Has anyone an idea, what could be the reason for this? Maybe the way how okhttp3 is processing proxies?
Notes: - Removing the local proxy in Retrofit2 and retry, it resolves correctly to my normal public IP - It's not an Orbot issue, because when I configure 127.0.0.1:8118 as browser proxy and change the circuit it works (public IP changes) - It shouldn't be a Retrofit caching problem, because I haven't configured cache and for every new try I build the Retrofit and okhttp3 client new.