You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by Tsha <gu...@163.com> on 2010/12/23 02:36:54 UTC
Need help for implementing a proxy server
Hi all,
I just start on Mina and try to accomplish a proxy server to record users' http requests. I made reference to the proxy example that Mina 2.0 has offered but found out that the server address is fixed.
I made some changes to establish connections to servers according to the users' requests.To archive that, I create a connector(NioSocketConnector) connect to dynamic address in the messageReceived function in IoHandler class. The code can work well when the page only send few concurrent requets(tryhttp://www.baidu.com) but block when the number of requests increases(tryhttp://mina.apache.org) with exceptions thrown.
Need your help. Here attaches the code I have tested.
Best wishes
Tina
Re: Need help for implementing a proxy server
Posted by Ashish <pa...@gmail.com>.
Take a few thread dumps and see where threads are stuck. Should give
some direction to work on.
thanks
ashish
2010/12/23 Tsha <gu...@163.com>:
> Hi all,
>
> I just start on Mina and try to accomplish a proxy server to record users'
> http requests. I made reference to the proxy example that Mina 2.0 has
> offered but found out that the server address is fixed.
> I made some changes to establish connections to servers according to the
> users' requests. To archive that, I create a
> connector(NioSocketConnector) connect to dynamic address in the
> messageReceived function in IoHandler class. The code can work well when the
> page only send few concurrent requets(try http://www.baidu.com) but
> block when the number of requests increases(try http://mina.apache.org) with
> exceptions thrown.
>
> Need your help. Here attaches the code I have tested.
>
> Best wishes
> Tina
>
>
--
thanks
ashish
Blog: http://www.ashishpaliwal.com/blog
My Photo Galleries: http://www.pbase.com/ashishpaliwal