Forward http message as is

rzo at gmx.de rzo at gmx.de
Mon Dec 28 07:50:22 EST 2009


Hello,

I have implemented this using netty.
I have implemented a proxy+waf (web application firewall)
It gets the http requests, analyzes them and if ok forwards the original stream to the web server. The HttpResponse is directly forwarded back to the client.

The handlers are as follows:

InterceptorHandler: onMessageReceived: store a copy of the message
HttpRequestHandler: parse the http request, if ok forward channel opened and the http request further upstream.
WafHandler: check the http request. if ok get the "bytes" from the interceptor and call next handler.
ProxyHandlers: as in the netty examples.

If you are interested I can post the code.
Should I add it as a patch ? or is it possible to attach files to this mailing list ?

-- Ron
http://yajsw.sourceforge.net

-------- Original-Nachricht --------
> Datum: Mon, 28 Dec 2009 21:06:24 +0900
> Von: "Trustin Lee (이희승)" <trustin at gmail.com>
> An: Netty Users <netty-users at lists.jboss.org>
> Betreff: Re: Forward http message as is

> Hi Leandro,
> 
> Currently, it's not possible without modifying the existing decoder
> implementation.  Because this feature has been requested sometimes, I
> will make sure to take into account for the next release.
> 
> Thanks,
> Trustin
> 
> Leandro Cruz wrote:
> > Hi All,
> > 
> > I'm trying to create a generic proxy (http, msn, etc) using netty.
> > I've checked out the proxy example, which is very nice. 
> > 
> > What I'd like to do is add the HttpRequestDecoder to the pipeline (so I
> > have a HttpRequest on messageReceived()), but forward the original
> > request (ChannelBuffer) to the original host/server.
> > 
> > Today this is not possible because HttpMessageDecoder uses
> > a ReplayingDecoderBuffer, which doesn't give me access to the "internal"
> > buffer/bytes. Another problem is that HttpRequest.getContent() is not a
> > replica of the original ChannelBuffer.
> > 
> > Ant ideas?
> > 
> > - 
> > Leandro Rodrigo Saad Cruz
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > netty-users mailing list
> > netty-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/netty-users
> 

-- 
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser


More information about the netty-users mailing list