[web-devel] proxy with wai
Michael Snoyman
michael at snoyman.com
Fri Mar 27 09:17:11 UTC 2015
Probably the most expedient thing is to use `withFile` to get a Handle, and
then use `conduitHandle` instead of `conduitFile`. However, if you want to
use ResourceT, it's certainly possible, but a bit hairier:
runResourceT $ withInternalState $ \is -> do
respond $ WC.responseSource (HCl.responseStatus res) headers
$ C.transPipe (flip runInternalState is) body
On Fri, Mar 27, 2015 at 11:01 AM Jos van den Oever <jos at vandenoever.info>
wrote:
> On Friday 27 March 2015 05:03:18 Michael Snoyman wrote:
> > Can you provide:
> >
> > * A complete file
> > * The error messages you're getting
>
> Of course.
>
> =====================
> No instance for (MonadResource IO)
> arising from a use of `fileSaver'
> In the second argument of `(C.=$=)', namely `fileSaver'
> In the expression: bodySource C.=$= fileSaver
> In an equation for `source2': source2 = bodySource C.=$= fileSaver
> HttpWrite.hs /proxy/src line 35 Haskell Problem
> =====================
>
> I know that I should somehow put some of the code a runResourceT, but I
> cannot
> figure out how to combine it with Wai.Application.
>
> Cheers,
> Jos
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/web-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/web-devel/attachments/20150327/397b5a4b/attachment.html>
More information about the web-devel
mailing list