elasticsearch/elasticsearch — pull request #3976 by salyh (2013-10-25 13:50:39+00:00)
Title: Adding methods to HttpRequest for retrieving informations about the http client (remoteaddr ...)

Added methods to ``org.elasticsearch.http.HttpRequest`` which can be used within ``RestFilters`` for retrieving informations about the http client (like remote address and remote port). The local address, local port and the X-Opaque-Id header can also be retrieved. remote address and remote port are mainly for security purposes like implementing a ``RestFilter`` which grant different privileges to different client hosts. If you know that your ``RestRequest`` is a ``HttpRequest`` (or check this via ``instanceof``) a cast to ``HttpRequest`` gives you access to the following new methods:

public String localAddr();
public long localPort();
public String remoteAddr();
public long remotePort();
public String opaqueId();

The modified ``org.elasticsearch.http.HttpRequest`` interface should not
break the https://github.com/sonian/elasticsearch-jetty plugin (and hopefully not any other code).