Reverse proxy HTTP requests, either over raw sockets or with WAI
Latest commit 607d876 Nov 19, 2015 @snoyberg snoyberg Travis


Provides a simple means of reverse-proxying HTTP requests. The raw approach uses the same technique as leveraged by keter, whereas the WAI approach performs full request/response parsing via WAI and http-conduit.

Raw example

The following sets up raw reverse proxying from local port 3000 to, port 80.

{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.ReverseProxy
import Data.Conduit.Network

main :: IO ()
main = runTCPServer (serverSettings 3000 "*") $ \appData ->
        (\_headers -> return $ Right $ ProxyDest "" 80)