A fast, light-weight HTTP server handler for WAI. Some random notes (a FAQ, if you will):
- When a
ResponseFileindicates 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.
- run :: Port -> Application -> IO ()
- runEx :: (SomeException -> IO ()) -> Port -> Application -> IO ()
- serveConnections :: (SomeException -> IO ()) -> Port -> Application -> Socket -> IO ()
- type Port = Int
- data InvalidRequest
- sendResponse :: Request -> HttpVersion -> Socket -> Response -> IO Bool
- parseRequest :: Port -> SockAddr -> Iteratee ByteString IO (Enumeratee ByteString ByteString IO a, Request)
Run a Warp server
Application on the given port, ignoring all exceptions.
Runs a server, listening on the given socket. The user is responsible for
closing the socket after
runWithSocket completes. You must also supply a
Port argument for use in the
serverPort record; however, this field is
only used for informational purposes. If you are in fact listening on a
non-TCP socket, this can be a ficticious value.