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] [Quick Jump]

Flags

Manual Flags

NameDescriptionDefault
pedantic

Enables -Werror, which turns warnings into errors.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

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
Change log CHANGELOG.markdown
Dependencies base (>=4.15.0 && <4.18), bytestring (>=0.10.12 && <0.12), connection (>=0.3.1 && <0.4), exceptions (>=0.10.4 && <0.11), network (>=3.1.1 && <3.2), websockets (>=0.12.7 && <0.13) [details]
License MIT
Author
Maintainer Taylor Fausak
Category Network
Source repo head: git clone https://github.com/tfausak/wuss
Uploaded by fozworth at 2023-02-12T20:19:34Z
Distributions Arch:2.0.1.1, LTSHaskell:2.0.1.7, NixOS:2.0.1.7, Stackage:2.0.1.7
Reverse Dependencies 27 direct, 11 indirect [details]
Downloads 16267 total (188 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-02-12 [all 1 reports]

Readme for wuss-2.0.1.1

[back to package description]

Wuss

Workflow Hackage Stackage

Secure WebSocket (WSS) clients in Haskell.


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.