A few quests
Brendt
draco2k4 at yahoo.com
Tue Jul 6 04:49:10 EDT 2010
Hi,
I'm trying to use netty to develope a HTTP proxy based application. I have
a few questions that I hope you will be able to answer.
Question One:
My proxy server forwards HTTP Requests for HTML files to Server A and images
(jpg, png, etc.) to Server B.
For public void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
method of SimpleChannelUpstreamHandler would e.getChannel() return the same
channel object for two separate HttpRequest objects from the same client?
(e.g. http://www.mysite.com/index.html and
http://www.mysite.com/images/myimage.jpg)
The reason I ask this is... I store a reference to the proxy-to-backend
channel based on the client-to-proxy channel. If the relationship exists in
my store, then I do not need to create a clientboostrap and call connect().
So you can see that if the first request is an HTML file, my proxy server
will create a proxy-to-backend channel to Server A and store the
relationship between the two. So if the second request is for a JPG and the
same client-to-proxy channel is used, I will find an existing relationship
and send the JPG request to Server A (which I obviously don't want to do).
Question Two:
As I've mentioned my proxy creates connections to multiple backend servers.
I have a ProxyResponseHandler (handles responses from the backend server and
relays them back to the client). In it's messsageReceived() method, after
writing the entire Http Response back to the client, should I be closing any
of the channels manually, or should I rely on the backend server notifying
netty of a channel closure?
Thanks,
Brendt
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/A-few-quests-tp5259423p5259423.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list