hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Lightbody <patr...@lightbody.net>
Subject Re: Reverse-proxy
Date Sun, 27 May 2012 15:28:03 GMT
Another project of interest might be https://github.com/webmetrics/browsermob-proxy. My company
uses it to capture performance data and do minor manipulations to the request/response itself,
such as remapping DNS host lookups or adding/removing headers. It produces HAR output, which
is a psuedo-spec used by tools like Firebug to show the URLs downloaded on a web page (http://www.softwareishard.com/har/viewer/).

Internally it uses a fork of a very old version of Jetty, which is capable of doing some nice
stuff around HTTP tunnels and SSL man-in-the-middle hacks to be able to examine secure requests.
The work is a derivative of work done as part of the Selenium browser automation framework.

Let me know anyone has questions or wants to team up on this stuff! The proxy is definitely
still a work in progress.

Patrick

--
Patrick Lightbody
+1 (415) 830-5488




On May 27, 2012, at 7:35 AM, kim young ill wrote:

> hi there, i'm doing kind of the similar thing to a contractor, using
> embedded-jetty as servlet container, entry-point is jetty-handler,which
> parse the requests, afterwards the request will be either dispatched to
> webapp-handler/webapp deployer (which loads a fullblown war webapp), or
> will "reparsed" to apache-httpclient-reuquest & dispatched to ahc client
> which retrieves content from internet.
> 
> from jetty-handler i also have access to (jee-compliant) session-manager &
> the whole servlet stacks of the request/response lifecycle
> 
> also wish i've known of your project before.
> 
> 
> cheers
> 
> 
> <olegk@apache.org> wrote:
> 
>> On Fri, 2012-05-25 at 17:44 +0200, Francois-Xavier Bonnet wrote:
>>> 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
>>> 
>> 
>> Hi Francois-Xavier
>> 
>> I think what you are describing is commonly referred to as a content
>> proxy. Curiously enough, I had to develop something very similar for one
>> of my commercial contracts. I wish I had known about the project at that
>> time.
>> 
>> I understand you have good reasons for using the standard JEE API for
>> your platform. It does make good sense given the objectives of your
>> project. At the same time this might make it less likely to fit into the
>> existing project mix at HttpComponents. My main concern is that after
>> the initial contribution there will be no one to support and maintain
>> the module in the long run.
>> 
>> Oleg
>> 
>>> 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
>>>> 
>>>> 
>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> 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