Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

91 lines (76 sloc) 3.272 kb
-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A fast, light-weight web server for WAI applications.
--
-- The premier WAI handler. For more information, see
-- <a>http://steve.vinoski.net/blog/2011/05/01/warp-a-haskell-web-server/</a>.
@package warp
@version 0.4.4
-- | A fast, light-weight HTTP server handler for WAI. Some random notes (a
-- FAQ, if you will):
--
-- <ul>
-- <li>When a <a>ResponseFile</a> indicates a file which does not exist,
-- an exception is thrown. This will close the connection to the client
-- as well. You should handle file existance checks at the application
-- level.</li>
-- </ul>
module Network.Wai.Handler.Warp
-- | Run an <a>Application</a> on the given port. This calls
-- <a>runSettings</a> with <a>defaultSettings</a>.
run :: Port -> Application -> IO ()
-- | Run a Warp server with the given settings.
runSettings :: Settings -> Application -> IO ()
-- | Same as <a>runSettings</a>, but uses a user-supplied socket instead of
-- opening one. This allows the user to provide, for example, Unix named
-- socket, which can be used when reverse HTTP proxying into your
-- application.
--
-- Note that the <a>settingsPort</a> will still be passed to
-- <a>Application</a>s via the <a>serverPort</a> record.
runSettingsSocket :: Settings -> Socket -> Application -> IO ()
-- | Various Warp 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 <a>Settings</a> value, use
-- <a>defaultSettings</a> and record syntax to modify individual records.
-- For example:
--
-- <pre>
-- defaultSettings { settingsTimeout = 20 }
-- </pre>
data Settings
-- | The default settings for the Warp server. See the individual settings
-- for the default value.
defaultSettings :: Settings
-- | Port to listen on. Default value: 3000
settingsPort :: Settings -> Int
-- | Host to bind to, or * for all. Default value: *
settingsHost :: Settings -> String
-- | What to do with exceptions thrown by either the application or server.
-- Default: ignore server-generated exceptions (see
-- <a>InvalidRequest</a>) and print application-generated applications to
-- stderr.
settingsOnException :: Settings -> SomeException -> IO ()
-- | Timeout value in seconds. Default value: 30
settingsTimeout :: Settings -> Int
type Port = Int
data InvalidRequest
NotEnoughLines :: [String] -> InvalidRequest
BadFirstLine :: String -> InvalidRequest
NonHttp :: InvalidRequest
IncompleteHeaders :: InvalidRequest
OverLargeHeader :: InvalidRequest
-- | A timeout manager
data Manager
-- | Call the inner function with a timeout manager.
withManager :: Int -> (Manager -> IO a) -> IO a
parseRequest :: Port -> SockAddr -> Iteratee ByteString IO (Integer, Request)
sendResponse :: Handle -> Request -> Socket -> Response -> IO Bool
registerKillThread :: Manager -> IO Handle
bindPort :: Int -> String -> IO Socket
enumSocket :: Handle -> Int -> Socket -> Enumerator ByteString IO a
resume, pause :: Handle -> IO ()
instance Typeable InvalidRequest
instance Show InvalidRequest
instance Eq InvalidRequest
instance Exception InvalidRequest
Jump to Line
Something went wrong with that request. Please try again.