| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Simplex.Messaging.Server.Web
Synopsis
- data EmbeddedWebParams = EmbeddedWebParams {
- webStaticPath :: FilePath
- webHttpPort :: Maybe Int
- webHttpsParams :: Maybe WebHttpsParams
- data WebHttpsParams = WebHttpsParams {}
- data EmbeddedContent = EmbeddedContent {
- indexHtml :: ByteString
- linkHtml :: ByteString
- mediaContent :: [(FilePath, ByteString)]
- wellKnown :: [(FilePath, ByteString)]
- serveStaticFiles :: EmbeddedWebParams -> IO ()
- attachStaticFiles :: FilePath -> (AttachHTTP -> IO ()) -> IO ()
- serveStaticPageH2 :: FilePath -> Request -> (Response -> IO ()) -> IO Bool
- generateSite :: EmbeddedContent -> ByteString -> [String] -> FilePath -> IO ()
- serverInfoSubsts :: String -> Maybe ServerPublicInfo -> [(ByteString, Maybe ByteString)]
- render :: ByteString -> [(ByteString, Maybe ByteString)] -> ByteString
- section_ :: ByteString -> Maybe ByteString -> ByteString -> ByteString
- item_ :: ByteString -> ByteString -> ByteString -> ByteString
- timedTTLText :: (Integral i, Show i) => i -> String
Documentation
data EmbeddedWebParams Source #
Constructors
| EmbeddedWebParams | |
Fields
| |
data WebHttpsParams Source #
Constructors
| WebHttpsParams | |
data EmbeddedContent Source #
Constructors
| EmbeddedContent | |
Fields
| |
serveStaticFiles :: EmbeddedWebParams -> IO () Source #
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
item_ :: ByteString -> ByteString -> ByteString -> ByteString Source #
Replace all occurrences of ${label} with provided content.
timedTTLText :: (Integral i, Show i) => i -> String Source #