Skip to content

jaspervdj/websockets

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

`instance Random Word32` is not available in `random-1.0.0.*`
72b6a72

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
March 30, 2022 10:00
May 13, 2017 12:55
May 13, 2017 12:55
March 30, 2022 10:00
web
April 20, 2022 11:43
September 23, 2011 16:26
November 28, 2015 19:05
March 30, 2022 10:00
November 4, 2011 09:13
April 16, 2017 21:39
September 8, 2011 19:57
September 9, 2013 18:58
April 20, 2022 11:43
April 20, 2022 11:43

websockets

Introduction

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

Authors

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.

Contributors:

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

Development

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.