/usr/share/doc/libghc-wai-websockets-doc/html/wai-websockets.txt is in libghc-wai-websockets-doc 3.0.0.8-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | -- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Provide a bridge between WAI and the websockets package.
--
-- API docs and the README are available at
-- <a>http://www.stackage.org/package/wai-websockets</a>.
@package wai-websockets
@version 3.0.0.8
module Network.Wai.Handler.WebSockets
-- | Upgrade a <tt>websockets</tt> <a>ServerApp</a> to a <tt>wai</tt>
-- <a>Application</a>. Uses the given backup <a>Application</a> to handle
-- <a>Request</a>s that are not WebSocket requests.
--
-- <pre>
-- websocketsOr opts ws_app backup_app = \req send_response ->
-- <b>case</b> <a>websocketsApp</a> opts ws_app req <b>of</b>
-- <a>Nothing</a> -> backup_app req send_response
-- <a>Just</a> res -> send_response res
-- </pre>
--
-- For example, below is an <a>Application</a> that sends <tt>"Hello,
-- client!"</tt> to each connected client.
--
-- <pre>
-- app :: <a>Application</a>
-- app = <a>websocketsOr</a> <a>defaultConnectionOptions</a> wsApp backupApp
-- <b>where</b>
-- wsApp :: <a>ServerApp</a>
-- wsApp pending_conn = do
-- conn <- <a>acceptRequest</a> pending_conn
-- <a>sendTextData</a> conn ("Hello, client!" :: <a>Text</a>)
--
-- backupApp :: <a>Application</a>
-- backupApp = <a>respondLBS</a> <a>status400</a> [] "Not a WebSocket request"
-- </pre>
websocketsOr :: ConnectionOptions -> ServerApp -> Application -> Application
-- | Handle a single <tt>wai</tt> <a>Request</a> with the given
-- <tt>websockets</tt> <a>ServerApp</a>. Returns <a>Nothing</a> if the
-- <a>Request</a> is not a WebSocket request, <a>Just</a> otherwise.
--
-- Usually, <a>websocketsOr</a> is more convenient.
websocketsApp :: ConnectionOptions -> ServerApp -> Request -> Maybe Response
-- | Returns whether or not the given <a>Request</a> is a WebSocket
-- request.
isWebSocketsReq :: Request -> Bool
getRequestHead :: Request -> RequestHead
-- | Internal function to run the WebSocket io-streams using the conduit
-- library.
runWebSockets :: ConnectionOptions -> RequestHead -> (PendingConnection -> IO a) -> IO ByteString -> (ByteString -> IO ()) -> IO a
|