Copyright | Andy Gill |
---|---|
License | BSD3 |
Maintainer | Andy Gill <andygill@ku.edu> |
Stability | unstable |
Portability | GHC |
Safe Haskell | None |
Language | Haskell98 |
A trivial web server.
This web server promotes a Request to IO Response function into a local web server. The user can decide how to interpret the requests, and the library is intended for implementing Ajax APIs.
initServerLazy (and assocated refactorings), and Chunking support was written by Henning Thielemann. Handling of POST-based payloads was been written by Brandon Moore. initServerBind support was written by John Van Enk.
Synopsis
- type Server = ()
- initServer :: Int -> (Request -> IO Response) -> IO Server
- initServerLazy :: Int -> Int -> (Request -> IO Response) -> IO Server
- initServerBind :: Int -> HostAddress -> (Request -> IO Response) -> IO Server
- initServerLazyBind :: Int -> Int -> HostAddress -> (Request -> IO Response) -> IO Server
- data Request = Request {}
- data Response = Response {}
- queryToArguments :: String -> [(String, String)]
- addCache :: Int -> (String, String)
- noCache :: (String, String)
- contentType :: String -> (String, String)
Documentation
:: Int | The port number |
-> (Request -> IO Response) | The functionality of the Server |
-> IO Server | A token for the Server |
This server transfers documents as one parcel, using the content-length header.
:: Int | Chunk size |
-> Int | The port number |
-> (Request -> IO Response) | The functionality of the Server |
-> IO Server | A token for the Server |
This server transfers documents in chunked mode and without content-length header. This way you can ship infinitely big documents. It inserts the transfer encoding header for you. The server binds to all interfaces
:: Int | The port number |
-> HostAddress | The host address |
-> (Request -> IO Response) | The functionality of the Server |
-> IO Server | A token for the Server |
This server transfers documents as one parcel, using the content-length header, and takes an additional
:: Int | Chunk size |
-> Int | The port number |
-> HostAddress | The host address |
-> (Request -> IO Response) | The functionality of the Server |
-> IO Server | A token for the Server |
This server transfers documents in chunked mode and without content-length header. This way you can ship infinitely big documents. It inserts the transfer encoding header for you. The server binds to the specified address.