-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A simple HTTP proxy server library
--
-- A library for writing HTTP proxy servers with the focus on simplicity,
-- flexibility and modularity. Allows arbitrary transformations on
-- requests and responses and custom caching methods. It's up to the user
-- to make sure that the message transformations are consistent with the
-- HTTP specification. The executable program is a simple non-caching
-- identity proxy and is used for testing the library.
@package haxy
@version 1.0
-- | A library for programming custom proxy servers.
module Network.HTTP.Proxy.Server
-- | Proxy entry-point. Spawns a new proxy server.
proxyMain :: HStream s => Settings s -> IO ()
-- | Proxy server settings
data Settings s
Settings :: (Request s -> IO (Request s)) -> (Request s -> Response s -> IO (Response s)) -> Cache s -> (Request s -> IO Bool) -> Logger -> Integer -> Maybe String -> Settings s
-- | A function for modifying requests. Will be called for each request
-- received; the modified request will be forwarded to the target server.
-- Defaults to an identity function.
requestModifier :: Settings s -> Request s -> IO (Request s)
-- | A function for modifying responses. Will be called for each response
-- received; the modified response will be forwarded to the client.
-- Defaults to an identity function.
responseModifier :: Settings s -> Request s -> Response s -> IO (Response s)
-- | The cache. Use def for no cache.
cache :: Settings s -> Cache s
-- | Authorization function. Allows denying certain requests. Defaults to
-- allowing all requests
isAuthorized :: Settings s -> Request s -> IO Bool
-- | A logging function. The default is stdLogger from http-server.
logger :: Settings s -> Logger
-- | Proxy server port number; default is 3128
portnum :: Settings s -> Integer
-- | The server host name. Defaults to the result of getHostName
hostname :: Settings s -> Maybe String
-- | The cache.
data Cache s
Cache :: (Request s -> IO (Maybe (Response s))) -> (Request s -> Response s -> IO ()) -> Cache s
-- | Retreive the response to a request from the cache.
queryCache :: Cache s -> Request s -> IO (Maybe (Response s))
-- | Record the response to a request in the cache.
recordInCache :: Cache s -> Request s -> Response s -> IO ()
-- | A class for types with a default value.
class Default a
def :: Default a => a
instance Default (Cache s)
instance Default (Settings s)