Lazyweb: ElasticSearch proxy

Hi all

We get a lot of people who want to use javascript to talk to their ElasticSearch server, directly from the browser.

This poses a problem, as ElasticSearch doesn't offer any authentication, or request filtering.

I'd like to write ElasticSearch::Proxy, which would be configurable to:

  • allow restriction on GET/HEAD/POST/PUT/DELETE requests

  • parse the incoming JSON request, filter out anything that shouldn't be allowed, and then forward the request on to the ES server

  • allow authenticated requests, with different permissions

With the module, I'd like to provide various ready made server configurations, ie you should be able to plug it into mod_perl, dancer, whatever...

I'm only familiar with mod_perl - haven't used any of the other frameworks.

LAZYWEB: What webservers should I target, and are there any existing modules which may be useful to use with the above?




Sounds like Plack and available Plack::Middleware would make this easy enough. Most if not all big web frameworks support PSGI so this would plugin without too much problems if written as a Plack::Middleware.

Look into Plack and its associated middleware

You could write this as Apache2::ElasticSearch, and get the bonus of using any of the many Apache based authentication modules.

I have Apache2::Proxy cooking in the oven right now and will be releasing that shortly. Feel free to ping me privately if you more details on that.

This sounds like Plack::Middleware to me as well.

As with everyone else, Plack::Middleware... would make it easy to use with different webservers (Apache, Starman etc etc) and also different frameworks.

Although I'm not sure how you'd go about having authentication from the framework just yet - smarter people than I can no doubt help you though.

Leave a comment

About Clinton Gormley

user-pic The doctor will see you now...