HORIZON HASKELLDocslts/ghc-9.14.xb2f3bfd2026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · b2f3bfd · 2026-10-11

Modulevortex-ws-0.2.1GHC2024

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.

  • 1 type
  • 5 values
  • Packagevortex-ws-0.2.1
  • Exports6
  • LanguageGHC2024
  • LicenceBSD-3-Clause
  • SourceWs.hs
datadata WsLimits
#

What one connection may cost before it is a Session.

Constructors

Instances2Eq, Show

Ten seconds to shake hands, a 64 KiB message and frame, and a ping every thirty seconds.

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.

valuewsSession :: Connection -> Session
#

A connection as a Session: text frames in and out, binary frames for a duplex call, the end of the stream when the peer goes.