Socks proxy support for Elasticsearch java client

Socks proxy support for Elasticsearch java client


Hi,
We are using elasticsearch java client and we need to configure SOCKS proxy for our application. Unfortunately http proxy is not an option for us.

I see some posts sent earlier but there was no clear, helpful answer.

As also described in How to set a socks5 proxy for ElasticsearchTemplate (Java Client) as well, HttpAsyncClient v4 doesn't have support for SOCKS proxy.
please also see another related topic in;
Can the java High Level REST client use a socks5 proxy?

I checked the options for integrating it with HttpAsyncClientBuilder#setConnectionManager but i couldn't find any working example, solution for it.
Elasticsearch java client uses HttpAsyncClient version which is not maintained anymore. Please also see elasticsearch-rest-client is using an old non-maintained version of httpasyncclient-4.1.4.jar · Issue #66136 · elastic/elasticsearch · GitHub.

new version is v5 and has socks proxy support.

Since i am not expert on HttpAsyncClient and Elasticsearch client, can you please give guide me to have SOCKS support somehow ?
Checked the https://lists.apache.org/thread/2jnhlt0h6td838hyyb6ydnxc86lrgsrx as well, but since ES client uses PoolingNHttpClientConnectionManager, it is not possible to easily set socket proxy for it.

Do you have some samples, suggestion guideline for integrating the connection manager by using org.apache.http.impl.nio.client.HttpAsyncClientBuilder#setConnectionManager ?

Thanks in advance
Ramazan