Reverse proxy HTTP requests, either over raw sockets or with WAI

Version on this page:
LTS Haskell 22.23:
Stackage Nightly 2024-05-26:
Latest on Hackage:

See all snapshots http-reverse-proxy appears in

BSD-3-Clause licensed by Michael Snoyman
Maintained by [email protected]
This version can be pinned in stack with:http-reverse-proxy-,2542

Module documentation for


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)


  • Add wpsLogRequest function which provides the ability to log the constructed Request.

  • Introduce a “semi cached body” to let the beginning of a request body be retried #34


  • Switch over to unliftio and conduit 1.3
  • Drop dependency on data-default-class, drop Default instances

  • Support http-conduit 2.3 in test suite #26


  • update wpsProcessBody to accept response’s initial request


  • add Eq, Ord, Show, Read instances to ProxyDest


  • add rawTcpProxyTo which can handle proxying connections without http headers #21

  • fixReqHeaders may create weird x-real-ip header #19

  • Minor doc cleanup

  • Use CPP so we can work with http-client pre and post 0.5 #17


  • Allow proxying to HTTPS servers. #15


  • Add configurable timeouts #8

  • Include and