Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

README.md 6.7 KiB

7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
7 anni fa
5 anni fa
5 anni fa
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. [![BCH compliance](https://bettercodehub.com/edge/badge/chkr1011/MQTTnet?branch=master)](https://bettercodehub.com/)
  8. [![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)
  9. [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://raw.githubusercontent.com/chkr1011/MQTTnet/master/LICENSE)
  10. # MQTTnet
  11. 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/>.
  12. ## Features
  13. ### General
  14. * Async support
  15. * TLS support for client and server (but not UWP servers)
  16. * Extensible communication channels (e.g. In-Memory, TCP, TCP+TLS, WS)
  17. * Lightweight (only the low level implementation of MQTT, no overhead)
  18. * Performance optimized (processing ~70.000 messages / second)*
  19. * Uniform API across all supported versions of the MQTT protocol
  20. * Interfaces included for mocking and testing
  21. * Access to internal trace messages
  22. * Unit tested (~250 tests)
  23. * No external dependencies
  24. \* 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_.
  25. ### Client
  26. * Communication via TCP (+TLS) or WS (WebSocket) supported
  27. * Included core _LowLevelMqttClient_ with low level functionality
  28. * Also included _ManagedMqttClient_ which maintains the connection and subscriptions automatically. Also application messages are queued and re-scheduled for higher QoS levels automatically.
  29. * Rx support (via another project)
  30. * Compatible with Microsoft Azure IoT Hub
  31. ### Server (broker)
  32. * List of connected clients available
  33. * Supports connected clients with different protocol versions at the same time
  34. * Able to publish its own messages (no loopback client required)
  35. * Able to receive every message (no loopback client required)
  36. * Extensible client credential validation
  37. * Retained messages are supported including persisting via interface methods (own implementation required)
  38. * WebSockets supported (via ASP.NET Core 2.0, separate nuget)
  39. * A custom message interceptor can be added which allows transforming or extending every received application message
  40. * Validate subscriptions and deny subscribing of certain topics depending on requesting clients
  41. * Connect clients with different protocol versions at the same time.
  42. ## MQTTnet Server
  43. _MQTTnet Server_ is a standalone cross platform MQTT server (like mosquitto) basing on this library. It has the following features.
  44. * Running portable (no installation required)
  45. * Runs under Windows, Linux, macOS, Raspberry Pi
  46. * Python scripting support for manipulating messages, validation of clients, building business logic etc.
  47. * Supports WebSocket and TCP (with and without TLS) connections
  48. * Provides a HTTP based API (including Swagger endpoint)
  49. * Extensive configuration parameters and customization supported
  50. ## Supported frameworks
  51. * .NET 5.0+
  52. * .NET Standard 1.3+
  53. * .NET Core 1.1+
  54. * .NET Core App 1.1+
  55. * .NET Framework 4.5.2+
  56. * Mono 5.2+
  57. * Universal Windows Platform (UWP) 10.0.10240+ (Windows 10 IoT Core)
  58. * Xamarin.Android 7.5+
  59. * Xamarin.iOS 10.14+
  60. * Blazor WebAssembly 3.2.0+
  61. ## Supported platforms
  62. * x86
  63. * x64
  64. * AnyCPU
  65. * ARM
  66. ## Supported OS
  67. * Windows
  68. * Windows 10 IoT Core
  69. * Linux (Ubuntu, Raspbian etc.)
  70. * macOS
  71. * Android
  72. * iOS
  73. ## Supported MQTT versions
  74. * 5.0.0
  75. * 3.1.1
  76. * 3.1.0
  77. ## Nuget
  78. This library is available as a nuget package: <https://www.nuget.org/packages/MQTTnet/>
  79. ## Examples
  80. Please find examples and the documentation at the Wiki of this repository (<https://github.com/chkr1011/MQTTnet/wiki>).
  81. ## Contributions
  82. 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.
  83. Also additions and updates in the Wiki are welcome.
  84. ## References
  85. This library is used in the following projects:
  86. * Azure Functions MQTT Bindings, <https://github.com/keesschollaart81/CaseOnline.Azure.WebJobs.Extensions.Mqtt>)
  87. * HA4IoT (Open Source Home Automation system for .NET, <https://github.com/chkr1011/HA4IoT>)
  88. * MQTT Client Rx (Wrapper for Reactive Extensions, <https://github.com/1iveowl/MQTTClient.rx>)
  89. * MQTT Client Rx (Managed Client Wrapper for Reactive Extensions, <https://github.com/mmuecke/RxMQTTnet>)
  90. * 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))
  91. * MQTTnet App (Cross platform client application for MQTT debugging, inspection etc., <https://github.com/chkr1011/MQTTnet.App>)
  92. * Wirehome.Core (Open Source Home Automation system for .NET Core, <https://github.com/chkr1011/Wirehome.Core>)
  93. * SparkplugNet (Sparkplug library for .Net, <https://github.com/SeppPenner/SparkplugNet>)
  94. * Silverback (Framework to build event-driven applications - support for MQTT, Kafka & RabbitMQ) <https://github.com/BEagle1984/silverback>
  95. Further projects using this project can be found under https://github.com/chkr1011/MQTTnet/network/dependents.
  96. If you use this library and want to see your project here please create a pull request.
  97. ## License
  98. MIT License
  99. MQTTnet Copyright (c) 2016-2021 Christian Kratky
  100. Permission is hereby granted, free of charge, to any person obtaining a copy
  101. of this software and associated documentation files (the "Software"), to deal
  102. in the Software without restriction, including without limitation the rights
  103. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  104. copies of the Software, and to permit persons to whom the Software is
  105. furnished to do so, subject to the following conditions:
  106. The above copyright notice and this permission notice shall be included in all
  107. copies or substantial portions of the Software.
  108. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  109. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  110. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  111. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  112. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  113. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  114. SOFTWARE.