Secure WebSocket (WSS) clients https://github.com/tfausak/wuss#readme

Latest on Hackage:1.1.17

See all snapshots wuss appears in

MIT licensed
Maintained by Taylor Fausak

Module documentation for 1.1.12

This version can be pinned in stack with:wuss-1.1.12@sha256:60648b228c64802add22d8d8a9732a72ed85724d7ccace1b04f75be7351c835c,1553


Secure WebSocket (WSS) clients in Haskell.

Version badge Build badge

Wuss is a library that lets you easily create secure WebSocket clients over the WSS protocol. It is a small addition to the websockets package and is adapted from existing solutions by @jaspervdj, @mpickering, and @elfenlaid.


To add Wuss as a dependency to your package, add it to your Cabal file.

build-depends: wuss

For other use cases, install it with Cabal.

$ cabal install wuss

Wuss uses Semantic Versioning. See the change log for a detailed list of changes.


import Wuss

import Control.Concurrent (forkIO)
import Control.Monad (forever, unless, void)
import Data.Text (Text, pack)
import Network.WebSockets (ClientApp, receiveData, sendClose, sendTextData)

main :: IO ()
main = runSecureClient "echo.websocket.org" 443 "/" ws

ws :: ClientApp ()
ws connection = do
    putStrLn "Connected!"

    void . forkIO . forever $ do
        message <- receiveData connection
        print (message :: Text)

    let loop = do
            line <- getLine
            unless (null line) $ do
                sendTextData connection (pack line)

    sendClose connection (pack "Bye!")

For more information about Wuss, please read the Haddock documentation.


Change log

Wuss uses Semantic Versioning. The change log is available through the releases on GitHub.

Used by 1 package in lts-13.11(full list with versions):