hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: NIO based Proxy/Cache
Date Fri, 18 Oct 2013 20:37:05 GMT
On Fri, 2013-10-18 at 12:55 -0700, Clover wrote:
> I'm looking to write an NIO based proxy/cache server in java.  I'd like to
> use as many standard APIs and 'off the shelf' implementations as possible.
> 
> I wrote a proof-of-concept using HttpCore (which is very fast btw) but
> there is not an HTTP caching implementation for HttpCore that I could find
> so I would have to write my own.
> 
> I wrote a second proof-of-concept using HttpCore and HttpClient but cannot
> take advantage of NIO.
> 
> Looks like the Async Client might be a useful part of what I'm trying to do.
> 
> I'm not super familar with all the components so I guess I'm looking for
> direction - what the best way to knit things together might be.  Any
> recommendations would be greatly appeciated.

You might take this reverse proxy sample app as a starting point and
make a caching proxy out of it [1]. As far as caching components are
concerned you might still benefit from forking and re-using protocol
logic from HttpClient Cache [2] but for really efficient caching proxy
implementation you would likely have to port it from classic i/o to NIO
or NIO2 [3]

Hope this helps

Oleg

[1]
http://svn.apache.org/repos/asf/httpcomponents/httpcore/tags/4.3/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
[2]
http://svn.apache.org/repos/asf/httpcomponents/httpclient/tags/4.3.1/httpclient-cache/
[3] http://docs.oracle.com/javase/tutorial/essential/io/fileio.html


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message