happstack-server-6.1.4: Web related tools and services.




HTTP Implementation

The Happstack HTTP implementation supports HTTP 1.0 and 1.1. Multiple request on a connection including pipelining is supported.


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.


parseResponse :: ByteString -> Either String ResponseSource

Unserializes the bytestring into a response. If there is an error it will return Left msg.

putRequest :: Handle -> Request -> IO ()Source

Serializes the request to the given handle

listen :: Conf -> (Request -> IO Response) -> IO ()Source

Bind and listen port

listen' :: Socket -> Conf -> (Request -> IO Response) -> IO ()Source

Use a previously bind port and listen



:: String

IP address to listen on (must be an IP address not a host name)

-> Int

port number to listen on

-> IO Socket