net-mqtt: An MQTT Protocol Implementation.

[ bsd3, library, network, program ] [ Propose Tags ] [ Report a vulnerability ]

Please see the README on GitHub at https://github.com/dustin/mqtt-hs#readme


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.1.0, 0.2.2.0, 0.2.3.0, 0.2.3.1, 0.2.4.0, 0.2.4.1, 0.2.4.2, 0.5.0.0, 0.5.0.1, 0.5.0.2, 0.5.1.0, 0.6.0.0, 0.6.0.1, 0.6.0.2, 0.6.1.0, 0.6.1.1, 0.6.2.0, 0.6.2.1, 0.6.2.2, 0.6.2.3, 0.7.0.0, 0.7.0.1, 0.7.1.0, 0.7.1.1, 0.8.0.0, 0.8.0.1, 0.8.0.2, 0.8.1.0, 0.8.2.0, 0.8.2.1, 0.8.2.2, 0.8.2.3, 0.8.2.4, 0.8.2.5, 0.8.3.0, 0.8.5.0, 0.8.6.0, 0.8.6.1
Change log Changelog.md
Dependencies async (>=2.2.1 && <2.3), attoparsec (>=0.13.2 && <0.14), attoparsec-binary (>=0.2 && <1.0), base (>=4.7 && <5), binary (>=0.8.5 && <0.9), bytestring (>=0.10.8 && <0.11), conduit (>=1.3.1 && <1.4), conduit-extra (>=1.3.0 && <1.4), connection (>=0.2.0 && <0.4), containers (>=0.5.0 && <0.7), deepseq (>=1.4.4.0 && <1.5), net-mqtt, network-conduit-tls (>=1.3.2 && <1.4), network-uri (>=2.6.1 && <2.7), optparse-applicative, QuickCheck (>=2.12.6.1 && <2.14), stm (>=2.4.0 && <2.6), text (>=1.2.3 && <1.3), websockets (>=0.12.5.3 && <0.13) [details]
License BSD-3-Clause
Copyright BSD3
Author Dustin Sallings
Maintainer dustin@spy.net
Category Network
Home page https://github.com/dustin/mqtt-hs#readme
Bug tracker https://github.com/dustin/mqtt-hs/issues
Source repo head: git clone https://github.com/dustin/mqtt-hs
Uploaded by dustin at 2020-05-27T04:16:50Z
Distributions LTSHaskell:0.8.6.1, NixOS:0.8.6.1
Reverse Dependencies 3 direct, 0 indirect [details]
Executables mqtt-watch, mqtt-example
Downloads 13944 total (162 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-05-27 [all 1 reports]

Readme for net-mqtt-0.7.0.1

[back to package description]

mqtt

An MQTT protocol implementation for Haskell.

Client Examples

Publish

main :: IO ()
main = do
  let (Just uri) = parseURI "mqtt://test.mosquitto.org"
  mc <- connectURI mqttConfig{} uri
  publish mc "tmp/topic" "hello!" False

Subscribe

main :: IO ()
main = do
  let (Just uri) = parseURI "mqtt://test.mosquitto.org"
  mc <- connectURI mqttConfig{_msgCB=SimpleCallback msgReceived} uri
  print =<< subscribe mc [("tmp/topic1", subOptions), ("tmp/topic2", subOptions)] []
  waitForClient mc   -- wait for the the client to disconnect

  where
    msgReceived _ t m p = print (t,m,p)