Forward http message as is

"Trustin Lee (이희승)" trustin at gmail.com
Mon Dec 28 20:01:17 EST 2009


By the way, I am thinking of some generic mechanism to keep the original
buffers and attach them to the decoded messages, ensuring maximum
performance.  Perhaps your patch might give me some idea. :)

rzo at gmx.de wrote:
> 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
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.jboss.org/pipermail/netty-users/attachments/20091229/ecc697f1/attachment.bin 


More information about the netty-users mailing list