Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Haskell library for creating WebSocket-capable servers
Haskell JavaScript HTML CSS Shell
Failed to load latest commit information.
benchmarks Bump cabal file
src/Network Bugfixes wrt closing sockets, bump to
tests Bugfixes wrt closing sockets, bump to
web Update website to use Hakyll 4
.ghci Add some haskell tests
.gitignore Add script to generate hpc program coverage
CHANGELOG Bugfixes wrt closing sockets, bump to
LICENCE Update copyright info Make README a markdown file
Setup.hs Initial commit Update coverage script
websockets.cabal Drop dependency on mtl



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 it's current state by Jasper Van der Jeugt, who is also the current maintainer.


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


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 two kinds of tests: Haskell-based tests (tests/haskell), which use the test-framework library. Additionally, there are integration tests available in tests/javascript, which require a browser to run.

Something went wrong with that request. Please try again.