hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francois-Xavier Bonnet <fx.bon...@esigate.org>
Subject Re: Reverse-proxy
Date Fri, 25 May 2012 15:44:05 GMT
Hi Oleg,

In fact the reverse proxy is only one part of our project. It is called
EsiGate http://www.esigate.org
The goal of the project is to have a tool that can be used to retrieve some
contents from different servers and aggregate them as a single web
application. The library is often used embeded inside a webapp and it
includes a reverse proxy servlet as well as taglibs and an implementation
of ESI specification in order to be able to extract and transform the
contents.
So we definitely need to run inside a servlet container.

The project is open source so if you see some things that could be
interesting to other people we could think about integrating to HttpClient
project.

Francois-Xavier

2012/5/21 Oleg Kalnichevski <olegk@apache.org>

> On Mon, 2012-05-21 at 15:19 +0200, Francois-Xavier Bonnet wrote:
> > Hi all,
> >
> > I am using HttpClient to do some reverse-proxy inside java web
> > applications. Maybe it could be useful to other people. What about
> adding a
> > reverse-proxy as a subproject to HttpClient project ?
> >
> > I was thinking of 2 classes :
> > - ProxyHttpRequest
> > - ProxyHttpResponse
> >
> > A basic use inside an HttpServlet would look like this :
> >
> > protected void doPost(HttpServletRequest httpServletRequest,
> > HttpServletResponse httpResponse)
> >             throws ServletException, IOException {
> >     HttpRequest httpRequest = new ProxyRequest(httpServletRequest);
> >     HttpResponse httpResponse = httpClient.execute(target, httpRequest);
> >     ProxyHttpResponse proxyHttpResponse = new
> > ProxyHttpResponse(httpResponse);I
> >     proxyHttpResponse.forward(httpServletResponse);
> > }
> >
> > So these classes would take care of all the problems of copying the right
> > Http headers and entity of the request or response. They will make the
> > translation between Servlet API and HttpClient API.
> > In addition it would be possible to modify the request or the response
> > before forwarding them depending on your needs.
> >
>
> Hi Francois-Xavier
>
> A reverse proxy module would be nice, but ideally it should be using
> HttpCore instead of Servlet API for management of incoming connections.
> At the same time your code would make a perfect sample application for
> HttpClient [1]. So, please feel free to contribute your code to the
> project as long as you are fine with it being distributed as reference
> material only.
>
> Cheers
>
> Oleg
>
> [1] http://hc.apache.org/httpcomponents-client-ga/examples.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> For additional commands, e-mail: dev-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message