# Recommended setup for javascript client & elasticsearch backend?

**URL:** <https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189>\
**Category:** Elasticsearch\
**Created:** [August 18, 2011, 8:33am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189 "2011-08-18T08:33:26Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_2](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Andy\_2](https://discuss.elastic.co/u/Andy_2)\
**Post date:** [August 18, 2011, 8:33am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/1 "2011-08-18T08:33:26Z")

</div>

Hi,

My front end is a browser-based javascript program that generates read-  
only queries. Should I have the js program communicating directly with  
elasticsearch? If not, is there any proxy/middleware setup you would  
recommend?

Thanks.

---

<div class="post-metadata">

**Author:** ![Sindre\_Sorhus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sindre_sorhus/32/3138_2.png) [@Sindre\_Sorhus](https://discuss.elastic.co/u/Sindre_Sorhus)\
**Post date:** [August 18, 2011, 3:03pm UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/2 "2011-08-18T15:03:33Z")

</div>

I just started using ES too.

I have a setup with a JS frontend directly communicating with ES. I'm using  
jQuery for JSONP and jQuery tmpl for templating. ES is fast, and returns a  
clean JSON file that you can dig out what you need with JS. I've had no  
problems communicating directly with ES, but it might depend on  
your environment and what you need to do with the results.

---

<div class="post-metadata">

**Author:** ![avasilenko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/avasilenko/32/2901_2.png) [@avasilenko](https://discuss.elastic.co/u/avasilenko)\
**Post date:** [August 18, 2011, 3:05pm UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/3 "2011-08-18T15:05:36Z")

</div>

How did you solve security vulnerability issues? Everyone can access your  
data and add, edit, delete it.

2011/8/18 Sindre Sorhus [sindresorhus@gmail.com](mailto:sindresorhus@gmail.com)

> I just started using ES too.
> 
> I have a setup with a JS frontend directly communicating with ES. I'm using  
> jQuery for JSONP and jQuery tmpl for templating. ES is fast, and returns a  
> clean JSON file that you can dig out what you need with JS. I've had no  
> problems communicating directly with ES, but it might depend on  
> your environment and what you need to do with the results.

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [August 18, 2011, 8:22pm UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/4 "2011-08-18T20:22:24Z")

</div>

There is a node.js proxy for elasticsearch:

> **[GitHub - lukas-vlcek/node.es: Node gadgets for Elastic Search](https://github.com/lukas-vlcek/node.es)**
>
> Node gadgets for Elastic Search. Contribute to lukas-vlcek/node.es development by creating an account on GitHub.

I was considering writing one for nginx, but I believe someone might already  
have done so.

--  
Ivan

On Thu, Aug 18, 2011 at 4:33 AM, Andy [selforganized@gmail.com](mailto:selforganized@gmail.com) wrote:

> Hi,
> 
> My front end is a browser-based javascript program that generates read-  
> only queries. Should I have the js program communicating directly with  
> elasticsearch? If not, is there any proxy/middleware setup you would  
> recommend?
> 
> Thanks.

---

<div class="post-metadata">

**Author:** ![Lukas\_Vlcek1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukas_vlcek1/32/819_2.png) [@Lukas\_Vlcek1](https://discuss.elastic.co/u/Lukas_Vlcek1)\
**Post date:** [August 18, 2011, 9:06pm UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/5 "2011-08-18T21:06:28Z")

</div>

Hi,

note that this proxy hasn't been updated for a while but I think it probably  
still works fine in most cases (it is highly configurable).  
But generally speaking you should not directly expose ES api. It can be  
really dangerous. You should deploy proxy (and there are more option, not  
only node.js)

Regards,  
Lukas

On Thu, Aug 18, 2011 at 10:22 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> There is a node.js proxy for elasticsearch:  
> [GitHub - lukas-vlcek/node.es: Node gadgets for Elastic Search](https://github.com/lukas-vlcek/node.es)
> 
> I was considering writing one for nginx, but I believe someone might  
> already have done so.
> 
> --  
> Ivan
> 
> On Thu, Aug 18, 2011 at 4:33 AM, Andy [selforganized@gmail.com](mailto:selforganized@gmail.com) wrote:
> 
> > Hi,
> > 
> > My front end is a browser-based javascript program that generates read-  
> > only queries. Should I have the js program communicating directly with  
> > elasticsearch? If not, is there any proxy/middleware setup you would  
> > recommend?
> > 
> > Thanks.

---

<div class="post-metadata">

**Author:** ![Andy\_2](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Andy\_2](https://discuss.elastic.co/u/Andy_2)\
**Post date:** [August 19, 2011, 12:05am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/6 "2011-08-19T00:05:08Z")

</div>

> There is a node.js proxy for elasticsearch:[GitHub - lukas-vlcek/node.es: Node gadgets for Elastic Search](https://github.com/lukas-vlcek/node.es)
> 
> I was considering writing one for nginx, but I believe someone might already  
> have done so.

Can you share a link to the nginx proxy?

---

<div class="post-metadata">

**Author:** ![Andy\_2](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Andy\_2](https://discuss.elastic.co/u/Andy_2)\
**Post date:** [August 19, 2011, 12:06am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/7 "2011-08-19T00:06:41Z")

</div>

> You should deploy proxy (and there are more option, not  
> only node.js)

Can you share those options? Any list of available proxies for  
elasticsearch?

---

<div class="post-metadata">

**Author:** ![Sindre\_Sorhus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sindre_sorhus/32/3138_2.png) [@Sindre\_Sorhus](https://discuss.elastic.co/u/Sindre_Sorhus)\
**Post date:** [August 19, 2011, 8:07am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/8 "2011-08-19T08:07:14Z")

</div>

It's running on a restricted network, so it's not really a problem.

But for my next project, I could need a Python proxy for ES. Someone make.  
😉

---

<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:** [July 6, 2017, 3:56am UTC](https://discuss.elastic.co/t/recommended-setup-for-javascript-client-elasticsearch-backend/5189/9 "2017-07-06T03:56:34Z")

</div>


