Skip to content
Reverse proxy HTTP requests, either over raw sockets or with WAI
Haskell
Latest commit 607d876 Nov 19, 2015 @snoyberg snoyberg Travis
Failed to load latest commit information.
Network/HTTP
test
.gitignore
.travis.yml
ChangeLog.md
LICENSE
README.md
Setup.hs
http-reverse-proxy.cabal
stack.yaml Add new new constructors to WaiProxyResponse instead of modifying Pro… Nov 18, 2015

README.md

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
Something went wrong with that request. Please try again.