-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A library for writing HTTP and HTTPS proxies -- -- http-proxy is a library for writing HTTP and HTTPS proxies. -- -- Use of the enumerator library provides file streaming from the -- upstream server through the proxy to the client program. Memory usage -- of the proxy depends on number of files being downlaoded -- simultaneously, not the size of the files being downloaded. -- -- Eventually, features like logging, request re-writing, disk caching -- etc will be made available via caller provided functions in the -- Settings data type. @package http-proxy @version 0.0 -- | This module contains a simple HTTP and HTTPS proxy. In the most basic -- setup, the caller specifies a port and runds it as follows: -- --
-- -- Run a HTTPS and HTTPS proxy on port 3128. -- import Network.HTTP.Proxy -- -- main :: IO () -- main = runProxy 3128 --module Network.HTTP.Proxy -- | Run a HTTP and HTTPS proxy server on the specified port. This calls -- runProxySettings with defaultSettings. runProxy :: Port -> IO () -- | Run a HTTP and HTTPS proxy server with the specified settings. runProxySettings :: Settings -> IO () -- | Various proxy server settings. This is purposely kept as an abstract -- data type so that new settings can be added without breaking backwards -- compatibility. In order to create a Settings value, use -- defaultSettings and record syntax to modify individual records. -- For example: -- --
-- defaultSettings { proxyPort = 3128 }
--
data Settings
Settings :: Int -> String -> (SomeException -> IO ()) -> Int -> Settings
-- | Port to listen on. Default value: 3100
proxyPort :: Settings -> Int
-- | Host to bind to, or * for all. Default value: *
proxyHost :: Settings -> String
-- | What to do with exceptions thrown by either the application or server.
-- Default: ignore server-generated exceptions (see
-- InvalidRequest) and print application-generated applications to
-- stderr.
proxyOnException :: Settings -> SomeException -> IO ()
-- | Timeout value in seconds. Default value: 30
proxyTimeout :: Settings -> Int
-- | The default settings for the Proxy server. See the individual settings
-- for the default value.
defaultSettings :: Settings
instance Typeable InvalidRequest
instance Show InvalidRequest
instance Eq InvalidRequest
instance Exception InvalidRequest