HORIZON HASKELLDocslts/ghc-10.0.x2b276322026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 2b27632 · 2026-10-31

Modulevortex-ws-0.2.2GHC2024

Vortex.Ws

The websocket mouth of a vortex. Each connection becomes one Session whose frames are text messages; identity is Anonymous, since a websocket carries no credential the transport could check: a host authenticates in band, or binds the mouth to a trusted network.

serveWs takes every connection as it comes. serveWsWith and serveWsOn hold a connection to WsLimits (a deadline for the handshake, a cap on a message and on a frame, no compression) and to a test of its request head, so a host can refuse what it never serves, such as a browser's cross-site request, before a Session exists.

Synopsis
  • Packagevortex-ws-0.2.2
  • Exports6
  • LanguageGHC2024
  • LicenceBSD-3-Clause
  • SourceWs.hs
datadata WsLimits

What one connection may cost before it is a Session.

Constructors

Instances2Eq, Show
valueserveWsOn
  1. :: WsLimits
  2. -> RequestHead -> Bool
  3. -> Socket
  4. -> Session -> IO ()
  5. -> IO ()

Serve on a socket already listening: a TCP one, or a unix one a service manager or the host made, for a proxy in front to reach. A connection that does not finish its handshake in time, or whose head the test refuses, is closed without a Session; a refused head is answered 403.