diff --git a/rumqttd/CHANGELOG.md b/rumqttd/CHANGELOG.md index e6e4b2f1b..28beeae71 100644 --- a/rumqttd/CHANGELOG.md +++ b/rumqttd/CHANGELOG.md @@ -8,12 +8,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- Log warning if websocket config is getting ignored ### Changed - Console endpoint /config prints Router Config instead of returning console settings - v4 config is optional, user can specify v4 and/or v5 config +- websocket feature is enabled by default ### Deprecated +- "websockets" feature is removed in favour of "websocket" ### Removed diff --git a/rumqttd/Cargo.toml b/rumqttd/Cargo.toml index 98ba385a6..54907d29b 100644 --- a/rumqttd/Cargo.toml +++ b/rumqttd/Cargo.toml @@ -39,11 +39,10 @@ axum = "0.6.20" rand = "0.8.5" [features] -default = ["use-rustls"] +default = ["use-rustls", "websocket"] use-rustls = ["dep:tokio-rustls", "dep:rustls-webpki", "dep:rustls-pemfile", "dep:x509-parser"] use-native-tls = ["dep:tokio-native-tls", "dep:x509-parser"] websocket = ["dep:async-tungstenite", "dep:tokio-util", "dep:futures-util", "dep:ws_stream_tungstenite"] -websockets = ["websocket"] validate-tenant-prefix = [] allow-duplicate-clientid = [] diff --git a/rumqttd/src/server/broker.rs b/rumqttd/src/server/broker.rs index 99e18eb5c..5eda9df9e 100644 --- a/rumqttd/src/server/broker.rs +++ b/rumqttd/src/server/broker.rs @@ -14,7 +14,7 @@ use flume::{RecvError, SendError, Sender}; use std::collections::HashMap; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::{Arc, Mutex}; -use tracing::{error, field, info, Instrument}; +use tracing::{error, field, info, warn, Instrument}; #[cfg(feature = "websocket")] use async_tungstenite::tokio::accept_hdr_async; @@ -230,6 +230,11 @@ impl Broker { } } + #[cfg(not(feature = "websocket"))] + if self.config.ws.is_some() { + warn!("websocket feature is disabled, [ws] config will be ignored."); + } + #[cfg(feature = "websocket")] if let Some(ws_config) = &self.config.ws { for (_, config) in ws_config.clone() {