servant-0.13: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.API.RemoteHost

Synopsis

Documentation

Use RemoteHost whenever your request handlers need the host or IP address from which the client issued the HTTP request. The corresponding handlers receive arguments of type SockAddr (from Network.Socket).

Example:

>>> -- POST /record-ip
>>> type API = "record-ip" :> RemoteHost :> Post '[] ()

data RemoteHost Source #

Provides access to the host or IP address from which the HTTP request was sent.

Instances

HasLink * sub => HasLink * ((:>) * RemoteHost sub) Source # 

Associated Types

type MkLink ((* :> RemoteHost) sub) (endpoint :: (* :> RemoteHost) sub) :: * Source #

Methods

toLink :: Proxy ((* :> RemoteHost) sub) endpoint -> Link -> MkLink ((* :> RemoteHost) sub) endpoint Source #

type MkLink * ((:>) * RemoteHost sub) Source # 
type MkLink * ((:>) * RemoteHost sub) = MkLink * sub