# Elasticsearch Native Java Client does not work behind proxy

**URL:** <https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063>\
**Category:** Elasticsearch\
**Created:** [March 11, 2020, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063 "2020-03-11T07:59:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![galew](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@galew](https://discuss.elastic.co/u/galew)\
**Post date:** [March 11, 2020, 7:59am UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063/1 "2020-03-11T07:59:23Z")

</div>

Hi,

I created new topic with new information.

We have Elasticsearch cluster which has own interfaces to interconnect (transport) traffic.

When the Elasticsearch Native Java Client used by Liferay connects our cluster using the given transportAddress(the proxy address and port) in its configuration file. It gets the response from Elasticsearch and gets the real addresses and tries to use them and fails. (Because there is no route from outer world to our interconnect)

Please any help how could either the Native Elastic client or Elasticsearch be configured to use the proxy so that the real addresses are not used in client's side?

Cheers

---

<div class="post-metadata">

**Author:** ![galew](https://avatars.discourse-cdn.com/v4/letter/g/e99b99/32.png) [@galew](https://discuss.elastic.co/u/galew)\
**Post date:** [March 11, 2020, 11:31am UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063/2 "2020-03-11T11:31:08Z")

</div>

Found the working configuration, for anyone who is interested

transportAddresses="10.1.10.10:8090,10.1.10.11:8090,10.1.10.12:8090"

operationMode="REMOTE"

clusterName="es-cluster"

clientTransportSniff="false"

---

<div class="post-metadata">

**Author:** ![Jerom5e](https://avatars.discourse-cdn.com/v4/letter/j/3d9bf3/32.png) [@Jerom5e](https://discuss.elastic.co/u/Jerom5e)\
**Post date:** [March 11, 2020, 11:56am UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063/3 "2020-03-11T11:56:01Z")

</div>

How do i connect with the java client to the elastic server by means of the Java API with a proxy in place[?](https://www.tellpopeyes.website)?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 11, 2020, 2:32pm UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063/4 "2020-03-11T14:32:08Z")

</div>

Welcome!

Would that help? [RestHighLevelClient - Accessing an elastic http endpoint behind reverse proxy](https://discuss.elastic.co/t/resthighlevelclient-accessing-an-elastic-http-endpoint-behind-reverse-proxy/117306)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 8, 2020, 2:32pm UTC](https://discuss.elastic.co/t/elasticsearch-native-java-client-does-not-work-behind-proxy/223063/5 "2020-04-08T14:32:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
