simplexmq-6.5.0.16: SimpleXMQ message broker
Safe HaskellSafe-Inferred
LanguageHaskell2010

Simplex.Messaging.Server.Web

Synopsis

Documentation

data EmbeddedWebParams Source #

Constructors

EmbeddedWebParams 

Fields

data WebHttpsParams Source #

Constructors

WebHttpsParams 

Fields

data EmbeddedContent Source #

Constructors

EmbeddedContent 

Fields

attachStaticFiles :: FilePath -> (AttachHTTP -> IO ()) -> IO () Source #

Prepare context and prepare HTTP handler for TLS connections that already passed TLS.handshake and ALPN check.

serveStaticPageH2 :: FilePath -> Request -> (Response -> IO ()) -> IO Bool Source #

Serve static files via HTTP/2 directly (without WAI). Path traversal protection: resolved path must stay under canonicalRoot. canonicalRoot must be pre-computed via canonicalizePath.

generateSite :: EmbeddedContent -> ByteString -> [String] -> FilePath -> IO () Source #

serverInfoSubsts :: String -> Maybe ServerPublicInfo -> [(ByteString, Maybe ByteString)] Source #

Substitutions for server information fields shared between SMP and XFTP pages.

render :: ByteString -> [(ByteString, Maybe ByteString)] -> ByteString Source #

Rewrite source with provided substitutions

section_ :: ByteString -> Maybe ByteString -> ByteString -> ByteString Source #

Rewrite section content inside x-label.../x-label markers. Markers are always removed when found. Closing marker is mandatory. If content is absent, whole section is removed. Section content is delegated to item_. If no sections found, the whole source is delegated.

item_ :: ByteString -> ByteString -> ByteString -> ByteString Source #

Replace all occurrences of ${label} with provided content.

timedTTLText :: (Integral i, Show i) => i -> String Source #