
29 Nov
2011
29 Nov
'11
7:47 a.m.
Greg,
But I'm talking about relaying for body of HTTP request. In other words, my concern is about uploading. In my company, uploading files whose size is some giga bytes is quite common. I don't know how to relay a uploading huge file with a fixed-size buffer with Warp.
Hi Kazu,
The most straightforward way I know of to do it is through a bounded channel (http://hackage.haskell.org/package/bounded-tchan or http://hackage.haskell.org/package/BoundedChan). You'd fork a thread to enumerate the output end of the socket and feed it request body chunks through the channel, then do the reverse to proxy the response.
Thank you for your suggestion. I guess these packages use MVar in deep inside and they are slow. Anyway, I will try. --Kazu