http3-0.0.18: HTTP/3 library
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.HQ.Server

Description

A server library for HTTP/0.9.

Synopsis

Runner

run :: Connection -> Config -> Server -> IO () Source #

Running an HQ server.

Runner arguments

data Config Source #

Configuration for HTTP/3 or HQ.

allocSimpleConfig :: IO Config Source #

Allocating a simple configuration with a handle-based position reader and a locally allocated timeout manager.

freeSimpleConfig :: Config -> IO () Source #

Freeing a simple configration.

HQ server

type Server = Request -> Aux -> (Response -> [PushPromise] -> IO ()) -> IO () #

Server type. Server takes a HTTP request, should generate a HTTP response and push promises, then should give them to the sending function. The sending function would throw exceptions so that they can be logged.

The sending function must only be called once.

Request

data Request #

Request from client.

Instances

Instances details
Show Request 
Instance details

Defined in Network.HTTP.Semantics.Server.Internal

Accessing request

requestPath :: Request -> Maybe Path #

Getting the path from a request.

Response

data Response #

Response from server.

Instances

Instances details
Show Response 
Instance details

Defined in Network.HTTP.Semantics.Server.Internal

Creating response

responseNoBody :: Status -> ResponseHeaders -> Response #

Creating response without body.

responseFile :: Status -> ResponseHeaders -> FileSpec -> Response #

Creating response with file.

responseStreaming :: Status -> ResponseHeaders -> ((Builder -> IO ()) -> IO () -> IO ()) -> Response #

Creating response with streaming.

responseBuilder :: Status -> ResponseHeaders -> Builder -> Response #

Creating response with builder.