hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Full duplex NHttpReverseProxy?
Date Mon, 08 Dec 2014 12:56:28 GMT
On Sun, 2014-12-07 at 23:50 +0400, Dmitry Potapov wrote:
> Hello everyone,
> 
> I was trying to implement async handler which will be able to send
> response prior to complete request consumption. For simplicity let's
> assume that we are talking about NHttpReverseProxy (I'm actually
> playing with it) example from the repo and we want to post entity
> which won't fit the RAM and the response won't fit the RAM either. So,
> proxy should work in full duplex mode, writing and reading bits of
> data in both directions.
>
> So, the full set of cruthes can be found here:
> https://gist.github.com/hirthwork/be613055884362ea68d3
> 
> My question is: are changes introduced into HttpAsyncService are legal
> and won't break anything? Is there better way to send response during
> request consumption?
> 

Dmitry
 
I think this behavior is illegal from the HTTP protocol standpoint. HTTP
is a request / response based protocol. While origin servers are allowed
to respond prematurely HTTP agents are expected to stop sending the
remainder of the content body in case of a out of sequence response and
discard the connection once the response has been processed.    

I am fairly confident about RFC 2616, though I am still not fully
through with RFC 7230 and related RFCs, so there might be changes in
this regard, but I seriously doubt that.

In this particular case you might be better off using WebSockets or some
other protocol.

Cheers

Oleg





---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message