Skip to content
Branch: master
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time


See the blog post about this code here.

This is an example of using [finagle] ( as a proxy to [Elasticsearch] ( It demonstrates proxying using the Elasticsearch native client, and creating an authentication layer in front of Elasticsearch.

The ESProxy object is a server (created using the cool [Twitter Server] ( template) that proxies all requests to an Elasticsearch cluster. The cluster settings (hosts and cluster name) can be controlled via initialization parameters (see the [ESProxy] ( code).

Doing a simple HTTP proxy to Elasticsearch is rather trivial. But building a proxy using the Elasticsearch native client requires a little hacking. We need to pass the request to the REST controller of Elasticsearch, provide it with a mock channel to capture the response and return it in our own server.

This example also shows how to add an authentication filter to the server which can be used to secure Elasticsearch for unauthorized access.


A demo proxy to Elasticsearch using finagle



No releases published
You can’t perform that action at this time.