From 1f37595200f76b521ea28efec7c6de89b204ea34 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Sun, 26 Nov 2023 15:38:28 -0300 Subject: [PATCH] make Mosquitto happy --- examples/mqtt-over-ws-client/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/mqtt-over-ws-client/main.c b/examples/mqtt-over-ws-client/main.c index 8d856fb2..c9d0008b 100644 --- a/examples/mqtt-over-ws-client/main.c +++ b/examples/mqtt-over-ws-client/main.c @@ -98,8 +98,9 @@ int main(void) { bool done = false; // Event handler flips it to true when done mg_mgr_init(&mgr); // Initialise event manager mg_log_set(MG_LL_DEBUG); // Set log level - mg_ws_connect(&mgr, s_url, fn, &done, NULL); // Create client connection - while (done == false) mg_mgr_poll(&mgr, 1000); // Event loop - mg_mgr_free(&mgr); // Finished, cleanup + mg_ws_connect(&mgr, s_url, fn, &done, "%s", // Create client connection + "Sec-Websocket-Protocol: mqtt\r\n"); // Request MQTT protocol + while (done == false) mg_mgr_poll(&mgr, 1000); // Event loop + mg_mgr_free(&mgr); // Finished, cleanup return 0; }