Request post fails when using proxy url



Post request fails with proxy settings

When I am connected to internet in office network, using LAN Settings -> Use automatic configuration script -> 'Proxy url',
Sending data to Countly server fails with an error
' Failed to connect to'

If I change the Internet connection to, using LAN Settings -> Automatically detect settings, it works fine.

How to make it work with custom proxy settings?


are you able to access Countly dashboard with the same proxy url in browser?


Yes, I can access dashboard.


Hi ar2rsawseen,

Any update on this? :point_up_2:


@arturs_k is there any reason why this URL would not work with Android SDK? Like slash in the middle, etc?


Any update on this? :point_up_2:


Hello. Just to clarify, I have a few questions.

You seem to be using android, could you tell us which device and which android version?

From what you have said, your proxy configuration works if you use auto-config, but it fails if you manually set custom proxy settings.

When using your custom settings, does opening web sites in the browser work?

Which countly version are you using? Could you show us how you init countly in your app? Could you also enable countly logging, use your app and then send us the generated log? This would give a better impression of what is happening internally.


Hi arturs_k,

I am using from desktop java application.
Yes, When using custom settings, I can open web sites in the browser.
Where do I get countly version?
Application Name: ISXD Web, if you can make out version from this.
Init code is here:

		OkHttpClient client = new OkHttpClient.Builder()
        .connectTimeout(2, TimeUnit.SECONDS)
		Retrofit retrofit = new Retrofit.Builder().baseUrl("")

		countlyService = retrofit.create(ICountlyService.class);	

public interface ICountlyService {

    "Accept: application/json",
    "User-Agent: Your-App-Name",
    "Cache-Control: no-cache",
    "content-type: application/json; charset=utf-8"
Call<Request> logData(@Body Request event);			

Countly logging: Printing response, here is the exception: Is this the one? connect timed out

at Method)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)
at Source)

Let me know, If I missed anything.


ok.. you had me confused, because at first I thought that you are using our android sdk :smile: That's why I was asking for the sdk version and the sdk internal logs.

You seem to be making direct requests to the countly server and trying to use our API without any SDK.

The capability of using proxies isn't influenced by the server side, so there seems to be some proxy configuration problem on your side and it's not really something that we can help with.

In your initial message you were showing this error "Failed to connect to" which seems to indicate that you are appending an ip address (maybe your proxy ip) to the target server url which then links to a non existing server endpoint.


Thank you for the detailed response :smile: