@hackage http-reverse-proxy0.6.0.1
Reverse proxy HTTP requests, either over raw sockets or with WAI
Categories
License
BSD-3-Clause
Maintainer
michael@fpcomplete.com
Links
Versions
Installation
Dependencies (18)
- base >=4.11 && <5
- blaze-builder >=0.3
- bytestring >=0.9
- case-insensitive >=0.4
- conduit >=1.3
- conduit-extra Show all…
Dependents (11)
@hackage/wai-middleware-crowd, @hackage/yesod-bin, @hackage/acme-everything, @hackage/prodapi-proxy, @hackage/keter, @hackage/yesod, Show all…
http-reverse-proxy
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 www.example.com, port 80.
{-# LANGUAGE OverloadedStrings #-}
import Network.HTTP.ReverseProxy
import Data.Conduit.Network
main :: IO ()
main = runTCPServer (serverSettings 3000 "*") $ \appData ->
rawProxyTo
(\_headers -> return $ Right $ ProxyDest "www.example.com" 80)
appData