wuss: Secure WebSocket (WSS) clients

[ library, mit, network ] [ Propose Tags ]

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.


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.0.0, 1.0.1, 1.0.2, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.1.10, 1.1.11, 1.1.12, 1.1.13, 1.1.14, 1.1.15, 1.1.16, 1.1.17, 1.1.18, 1.1.19, 2.0.0.0, 2.0.0.1, 2.0.0.2, 2.0.1.0, 2.0.1.1, 2.0.1.2, 2.0.1.3, 2.0.1.4, 2.0.1.5, 2.0.1.6, 2.0.1.7, 2.0.1.8
Change log CHANGELOG.md
Dependencies base (>=4 && <5), bytestring, connection (>=0.2 && <0.3), network, websockets (>=0.9 && <0.10) [details]
License MIT
Copyright 2015 Taylor Fausak <taylor@fausak.me>
Author Taylor Fausak <taylor@fausak.me>
Maintainer Taylor Fausak <taylor@fausak.me>
Category Network
Home page http://taylor.fausak.me/wuss/
Bug tracker https://github.com/tfausak/wuss/issues
Source repo head: git clone https://github.com/tfausak/wuss
Uploaded by fozworth at 2015-06-05T01:06:53Z
Distributions Arch:2.0.1.1, LTSHaskell:2.0.1.7, NixOS:2.0.1.7, Stackage:2.0.1.8
Reverse Dependencies 27 direct, 11 indirect [details]
Downloads 16284 total (166 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-06-10 [all 1 reports]

Readme for wuss-1.0.1

[back to package description]

Wuss

Secure WebSocket (WSS) clients in Haskell.

Version Build Dependencies


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.

Installation

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

build-depends: wuss ==1.0.*

For other use cases, install it with Cabal.

$ cabal install 'wuss ==1.0.*'

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

Usage

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)
                loop
    loop

    sendClose connection (pack "Bye!")

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