You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.7 KiB

7 years ago
5 years ago
6 years ago
7 years ago
6 years ago
7 years ago
6 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
6 years ago
5 years ago
7 years ago
7 years ago
7 years ago
7 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <p align="center">
  2. <img src="https://github.com/chkr1011/MQTTnet/blob/master/Images/icon_det_256.png?raw=true" width="196">
  3. <br/>
  4. <br/>
  5. </p>
  6. [![NuGet Badge](https://buildstats.info/nuget/MQTTnet)](https://www.nuget.org/packages/MQTTnet)
  7. [![Build status](https://ci.appveyor.com/api/projects/status/ycit86voxfevm2aa/branch/master?svg=true)](https://ci.appveyor.com/project/chkr1011/mqttnet)
  8. [![BCH compliance](https://bettercodehub.com/edge/badge/chkr1011/MQTTnet?branch=master)](https://bettercodehub.com/)
  9. [![OpenCollective](https://opencollective.com/mqttnet/backers/badge.svg)](https://opencollective.com/mqttnet)
  10. [![OpenCollective](https://opencollective.com/mqttnet/sponsors/badge.svg)](https://opencollective.com/mqttnet) [![Join the chat at https://gitter.im/MQTTnet/community](https://badges.gitter.im/MQTTnet/community.svg)](https://gitter.im/MQTTnet/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  11. [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/chkr1011/MQTTnet/master/LICENSE)
  12. # MQTTnet
  13. MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from <http://mqtt.org/>.
  14. ## Features
  15. ### General
  16. * Async support
  17. * TLS 1.2 support for client and server (but not UWP servers)
  18. * Extensible communication channels (e.g. In-Memory, TCP, TCP+TLS, WS)
  19. * Lightweight (only the low level implementation of MQTT, no overhead)
  20. * Performance optimized (processing ~70.000 messages / second)*
  21. * Uniform API across all supported versions of the MQTT protocol
  22. * Interfaces included for mocking and testing
  23. * Access to internal trace messages
  24. * Unit tested (~210 tests)
  25. * No external dependencies
  26. \* Tested on local machine (Intel i7 8700K) with MQTTnet client and server running in the same process using the TCP channel. The app for verification is part of this repository and stored in _/Tests/MQTTnet.TestApp.NetCore_.
  27. ### Client
  28. * Communication via TCP (+TLS) or WS (WebSocket) supported
  29. * Included core _MqttClient_ with low level functionality
  30. * Also included _ManagedMqttClient_ which maintains the connection and subscriptions automatically. Also application messages are queued and re-scheduled for higher QoS levels automatically.
  31. * Rx support (via another project)
  32. * Compatible with Microsoft Azure IoT Hub
  33. ### Server (broker)
  34. * List of connected clients available
  35. * Supports connected clients with different protocol versions at the same time
  36. * Able to publish its own messages (no loopback client required)
  37. * Able to receive every message (no loopback client required)
  38. * Extensible client credential validation
  39. * Retained messages are supported including persisting via interface methods (own implementation required)
  40. * WebSockets supported (via ASP.NET Core 2.0, separate nuget)
  41. * A custom message interceptor can be added which allows transforming or extending every received application message
  42. * Validate subscriptions and deny subscribing of certain topics depending on requesting clients
  43. * Connect clients with different protocol versions at the same time.
  44. ## MQTTnet Server
  45. _MQTTnet Server_ is a standalone cross platform MQTT server (like mosquitto) basing on this library. It has the following features.
  46. * Running portable (no installation required)
  47. * Runs und Windows, Linux, macOS, Raspberry Pi
  48. * Python scripting support for manipulating messages, validation of clients, building business logic etc.
  49. * Supports WebSocket and TCP (with and without TLS) connections
  50. * Provides a HTTP based API (including Swagger endpoint)
  51. * Extensive configuration parameters and customization supported
  52. ## Supported frameworks
  53. * .NET Standard 1.3+
  54. * .NET Core 1.1+
  55. * .NET Core App 1.1+
  56. * .NET Framework 4.5.2+ (x86, x64, AnyCPU)
  57. * Mono 5.2+
  58. * Universal Windows Platform (UWP) 10.0.10240+ (x86, x64, ARM, AnyCPU, Windows 10 IoT Core)
  59. * Xamarin.Android 7.5+
  60. * Xamarin.iOS 10.14+
  61. ## Supported MQTT versions
  62. * 5.0.0
  63. * 3.1.1
  64. * 3.1.0
  65. ## Nuget
  66. This library is available as a nuget package: <https://www.nuget.org/packages/MQTTnet/>
  67. ## Examples
  68. Please find examples and the documentation at the Wiki of this repository (<https://github.com/chkr1011/MQTTnet/wiki>).
  69. ## Contributions
  70. If you want to contribute to this project just create a pull request. But only pull requests which are matching the code style of this library will be accepted. Before creating a pull request please have a look at the library to get an overview of the required style.
  71. Also additions and updates in the Wiki are welcome.
  72. **This project, like all projects requires time and money. If you feel compelled to support the development team, you can do so through Open Collective (https://opencollective.com/mqttnet)**.
  73. ## References
  74. This library is used in the following projects:
  75. * Azure Functions MQTT Bindings, [CaseOnline.Azure.WebJobs.Extensions.Mqtt](https://github.com/keesschollaart81/CaseOnline.Azure.WebJobs.Extensions.Mqtt/)
  76. * HA4IoT (Open Source Home Automation system for .NET, <https://github.com/chkr1011/HA4IoT>)
  77. * MQTT Client Rx (Wrapper for Reactive Extensions, <https://github.com/1iveowl/MQTTClient.rx>)
  78. * MQTT Tester (MQTT client test app for [Android](https://play.google.com/store/apps/details?id=com.liveowl.mqtttester) and [iOS](https://itunes.apple.com/us/app/mqtt-tester/id1278621826?mt=8))
  79. * Wirehome.Core (Open Source Home Automation system for .NET Core, <https://github.com/chkr1011/Wirehome.Core>)
  80. Further projects using this project can be found under https://github.com/chkr1011/MQTTnet/network/dependents.
  81. If you use this library and want to see your project here please create a pull request.
  82. ## License
  83. MIT License
  84. MQTTnet Copyright (c) 2016-2019 Christian Kratky
  85. Permission is hereby granted, free of charge, to any person obtaining a copy
  86. of this software and associated documentation files (the "Software"), to deal
  87. in the Software without restriction, including without limitation the rights
  88. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  89. copies of the Software, and to permit persons to whom the Software is
  90. furnished to do so, subject to the following conditions:
  91. The above copyright notice and this permission notice shall be included in all
  92. copies or substantial portions of the Software.
  93. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  94. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  95. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  96. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  97. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  98. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  99. SOFTWARE.