IMHO, keeping the original buffer is really usefull.<div><br></div><div>--<br clear="all">Leandro Rodrigo Saad Cruz<br>
<br><br><div class="gmail_quote">On Mon, Dec 28, 2009 at 11:01 PM, "Trustin Lee (ÀÌÈñ½Â)" <span dir="ltr"><<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
By the way, I am thinking of some generic mechanism to keep the original<br>
buffers and attach them to the decoded messages, ensuring maximum<br>
performance. Perhaps your patch might give me some idea. :)<br>
<div><div></div><div class="h5"><br>
<a href="mailto:rzo@gmx.de">rzo@gmx.de</a> wrote:<br>
> Hello,<br>
><br>
> I have implemented this using netty.<br>
> I have implemented a proxy+waf (web application firewall)<br>
> 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.<br>
><br>
> The handlers are as follows:<br>
><br>
> InterceptorHandler: onMessageReceived: store a copy of the message<br>
> HttpRequestHandler: parse the http request, if ok forward channel opened and the http request further upstream.<br>
> WafHandler: check the http request. if ok get the "bytes" from the interceptor and call next handler.<br>
> ProxyHandlers: as in the netty examples.<br>
><br>
> If you are interested I can post the code.<br>
> Should I add it as a patch ? or is it possible to attach files to this mailing list ?<br>
><br>
> -- Ron<br>
> <a href="http://yajsw.sourceforge.net" target="_blank">http://yajsw.sourceforge.net</a><br>
><br>
> -------- Original-Nachricht --------<br>
>> Datum: Mon, 28 Dec 2009 21:06:24 +0900<br>
>> Von: "Trustin Lee (ÀÌÈñ½Â)" <<a href="mailto:trustin@gmail.com">trustin@gmail.com</a>><br>
>> An: Netty Users <<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a>><br>
>> Betreff: Re: Forward http message as is<br>
><br>
>> Hi Leandro,<br>
>><br>
>> Currently, it's not possible without modifying the existing decoder<br>
>> implementation. Because this feature has been requested sometimes, I<br>
>> will make sure to take into account for the next release.<br>
>><br>
>> Thanks,<br>
>> Trustin<br>
>><br>
>> Leandro Cruz wrote:<br>
>>> Hi All,<br>
>>><br>
>>> I'm trying to create a generic proxy (http, msn, etc) using netty.<br>
>>> I've checked out the proxy example, which is very nice.<br>
>>><br>
>>> What I'd like to do is add the HttpRequestDecoder to the pipeline (so I<br>
>>> have a HttpRequest on messageReceived()), but forward the original<br>
>>> request (ChannelBuffer) to the original host/server.<br>
>>><br>
>>> Today this is not possible because HttpMessageDecoder uses<br>
>>> a ReplayingDecoderBuffer, which doesn't give me access to the "internal"<br>
>>> buffer/bytes. Another problem is that HttpRequest.getContent() is not a<br>
>>> replica of the original ChannelBuffer.<br>
>>><br>
>>> Ant ideas?<br>
>>><br>
>>> -<br>
>>> Leandro Rodrigo Saad Cruz<br>
>>><br>
>>><br>
>>> ------------------------------------------------------------------------<br>
>>><br>
>>> _______________________________________________<br>
>>> netty-users mailing list<br>
>>> <a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
>>> <a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
><br>
<br>
</div></div><br>_______________________________________________<br>
netty-users mailing list<br>
<a href="mailto:netty-users@lists.jboss.org">netty-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/netty-users" target="_blank">https://lists.jboss.org/mailman/listinfo/netty-users</a><br>
<br></blockquote></div><br></div>