-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A simple HTTP proxy server library -- @package haxy @version 0.9 -- | 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) -> (String -> IO ()) -> 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 no logging. logger :: Settings s -> String -> IO () -- | 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)