A Haskell library for creating WebSocket-capable servers
Haskell JavaScript HTML CSS Python C Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.circleci Move to CircleCI, bump QuickCheck to 2.10 Jan 2, 2018
cbits Further mask fixes May 13, 2017
example Slight simplification in server.lhs May 11, 2018
src/Network Fix build with GHC 7.6 and 7.8 Jun 12, 2018
tests Remove dependency on `blaze-builder` Mar 12, 2018
.gitignore Added stack.yaml Nov 29, 2015
CHANGELOG Bump version to Jun 12, 2018
LICENCE Update copyright info Nov 4, 2011
README.md Website updates Apr 16, 2017
stack.yaml Bump version to Jun 12, 2018




Provides a sensible, clean and simple way to write WebSocket-capable servers in Haskell.

The following program echoes messages back after appending meow:

{-# LANGUAGE OverloadedStrings #-}
import           Control.Monad      (forever)
import qualified Data.Text          as T
import qualified Network.WebSockets as WS

meow :: WS.Connection -> IO ()
meow conn = forever $ do
    msg <- WS.receiveData conn
    WS.sendTextData conn $ msg `T.append` ", meow"

Installation is provided using cabal:

$ cabal install websockets


An initial WebSockets library was written in 2010 by Siniša Biđin. In 2011, it was rewritten from scratch, and extended to its current state by Jasper Van der Jeugt, who is also the current maintainer.


  • Alex Lang
  • Carl Chatfield
  • Fedor Gogolev
  • Marcin Tolysz
  • Nathan Howell
  • Steffen Schuldenzucker
  • Yi Huang


Pull requests are always welcome!

This library is production-quality. Therefore we have very high standards in terms of code style, API quality and testing.

We have three kinds of tests:

  • Haskell-based tests (tests/haskell), which use the test-framework library
  • Integration tests, available in tests/javascript. These require a browser to run.
  • We also run the extensive autobahn testsuite.