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

Happstack.Server.Internal.LowLevel

Contents

Synopsis

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.

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

listenOnIPv4Source

Arguments

:: String

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

-> Int

port number to listen on

-> IO Socket