talira

websockets (Haskell)

A Haskell library for creating WebSocket-capable servers

open sourceBSD-3-Clausefree

websockets is a Haskell library for writing WebSocket servers, and clients, with a small API: accept a pending connection, then receive and send text or binary messages on it, with a withPingPong helper to detect stale connections. It handles only insecure ws:// connections; for secure wss:// its package description points to Wuss. An initial library by Siniša Biđin (2010) was rewritten in 2011 by Jasper Van der Jeugt, who maintains it.

Problems it solves

  • add a WebSocket server to my Haskell application
  • push live updates from a Haskell backend to the browser
  • connect to a WebSocket server from Haskell

Features

  • WebSocket server and client in Haskell
  • text and binary messages over a simple connection API
  • withPingPong helper to detect stale connections
  • example echo server and client in the repository

Limitations

  • Supports only insecure ws:// connections; secure wss:// needs another library such as Wuss.1