You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Clover <no...@gmail.com> on 2013/10/18 21:55:39 UTC
NIO based Proxy/Cache
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.
Re: NIO based Proxy/Cache
Posted by Oleg Kalnichevski <ol...@apache.org>.
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