[web-devel] proxy with wai

Jos van den Oever jos at vandenoever.info
Sat Mar 21 09:32:37 UTC 2015


On Sunday 08 March 2015 07:28:30 Michael Snoyman wrote:
> I've updated that Gist to be compatible with WAI 3.0.

Thank you very much. I've been studying that code and have successfully made a 
proxy on top of Warp and am now adding a user interface on top with Yesod.

I've made a tweak to the code a bit. In the gist you throw out most of the 
request and response headers. I've found that it's enough to only throw away 
the content-encoding and content-length headers:

        headers = filter removeEncodingHeaders $ HCl.responseHeaders res
        respond $ WC.responseSource (HCl.responseStatus res) headers body
  where
    -- remove encoding information
    removeEncodingHeaders (k, _) = k `notElem` [ "content-encoding", "content-
length" ]

Cheers,
Jos



More information about the web-devel mailing list