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]
Versions 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
Change log CHANGELOG.markdown
Dependencies base (>=4.9.0 && <4.12), bytestring (>=0.10.8 && <0.11), connection (>=0.2.6 && <0.3), network (>=2.6.3 && <2.8), websockets (>=0.9.7 && <0.13) [details]
License MIT
Author
Maintainer Taylor Fausak
Category Network
Home page https://github.com/tfausak/wuss#readme
Bug tracker https://github.com/tfausak/wuss/issues
Source repo head: git clone https://github.com/tfausak/wuss
Uploaded by fozworth at Sat Jul 14 20:04:49 UTC 2018
Distributions LTSHaskell:1.1.10, NixOS:1.1.10, Stackage:1.1.10
Downloads 2826 total (226 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-07-14 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for wuss-1.1.10

[back to package description]

Wuss

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.

Installation

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.

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.