- request :: Handle -> Conf -> Socket -> Host -> (Request -> IO Response) -> IO ()
- parseResponse :: ByteString -> Either String Response
- putRequest :: Handle -> Request -> IO ()
- listen :: Conf -> (Request -> IO Response) -> IO ()
- listen' :: Socket -> Conf -> (Request -> IO Response) -> IO ()
- listenOn :: Int -> IO Socket
- listenOnIPv4 :: String -> Int -> IO Socket
- module Happstack.Server.Internal.Types
HTTP Implementation
The Happstack HTTP implementation supports HTTP 1.0 and 1.1. Multiple request on a connection including pipelining is supported.
Problems
Currently if a client sends an invalid HTTP request the whole connection is aborted and no further processing is done.
When the connection times out Happstack closes it. In future it could send a 408 response but this may be problematic if the sending of a response caused the problem.
API
parseResponse :: ByteString -> Either String ResponseSource
Unserializes the bytestring into a response. If there is an
error it will return Left msg
.
listen' :: Socket -> Conf -> (Request -> IO Response) -> IO ()Source
Use a previously bind port and listen