[web-devel] Advice on implementing a web proxy
Kazu Yamamoto ( 山本和彦 )
kazu at iij.ad.jp
Tue Nov 29 13:47:35 CET 2011
>> 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.
More information about the web-devel