rmqtt-net
🔌 rmqtt-net provides a foundational implementation of an MQTT server network layer, supporting MQTT v3.1.1 and v5.0 protocols over TCP, TLS, and WebSocket transports. It is designed for flexibility, performance, and easy integration into custom broker logic.
✨ Features
- ✅ MQTT v3.1.1 & v5.0 protocol support
- 🔐 Optional TLS via [
rustls
] backend (AWS-LC or ring, depending on platform) - 🌐 WebSocket transport support (optional via feature flag)
- ⚡ Built with async I/O using Tokio
- 🛠️ Simple
Builder
-based API for configuration and extensibility
🚀 Basic Usage
use ;
use SocketAddr;
async
async
async
🔧 Crate Usage
Add rmqtt-net
to your Cargo.toml
, with optional TLS/WebSocket support:
[]
= { = "0.1", = ["tls", "ws"] }
tls
: Enables TLS support usingrustls
ws
: Enables WebSocket transport
📦 Exposed Components
Builder
/Listener
– Configure and bind MQTT listenersMqttStream
– Abstract stream wrapper supporting v3/v5 logicMqttError
– Common error type for network operations- Platform-specific TLS provider via
tls_provider
alias - Feature-gated modules for TLS and WebSocket
✅ Platform Notes
- On non-Windows: uses
aws-lc-rs
as TLS backend - On Windows: uses
ring
as TLS backend