-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mosquitto: enable websockets, using libwebsockets 3.0.0
A websocket listener is configured on port 9001 The default libwebsockets version in Rocko, 2.1.0, doesn't work with this mosquitto version; 1.4.14, see: eclipse-mosquitto/mosquitto#336 (comment) Therefore install a newer libwebsockets version, 3.0.0, copied from master: openembedded/meta-openembedded@abead52 Security considerations: by default mosquitto is disabled. When enabled, it listens on all interfaces, port 1883. Adding a websockets listener on port 9001 doesn't change the level of security.
- Loading branch information
Showing
4 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
meta-alternatives/recipes-connectivity/libwebsockets/libwebsockets_3.0.0.bb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
SUMMARY = "Canonical libwebsockets.org websocket library" | ||
HOMEPAGE = "https://libwebsockets.org/" | ||
LICENSE = "LGPL-2.1" | ||
LIC_FILES_CHKSUM = "file://LICENSE;md5=4ce87f3facb6f911c142c8bef9bfb380" | ||
|
||
DEPENDS = "zlib" | ||
|
||
S = "${WORKDIR}/git" | ||
SRCREV = "eaa935a80adb38b5cc4d09ce06ec987b87dcddfa" | ||
SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;" | ||
|
||
inherit cmake pkgconfig | ||
|
||
PACKAGECONFIG ?= "libuv client server http2 ssl" | ||
PACKAGECONFIG[client] = "-DLWS_WITHOUT_CLIENT=OFF,-DLWS_WITHOUT_CLIENT=ON," | ||
PACKAGECONFIG[http2] = "-DLWS_WITH_HTTP2=ON,-DLWS_WITH_HTTP2=OFF," | ||
PACKAGECONFIG[ipv6] = "-DLWS_IPV6=ON,-DLWS_IPV6=OFF," | ||
PACKAGECONFIG[libev] = "-DLWS_WITH_LIBEV=ON,-DLWS_WITH_LIBEV=OFF,libev" | ||
PACKAGECONFIG[libuv] = "-DLWS_WITH_LIBUV=ON,-DLWS_WITH_LIBUV=OFF,libuv" | ||
PACKAGECONFIG[server] = "-DLWS_WITHOUT_SERVER=OFF,-DLWS_WITHOUT_SERVER=ON," | ||
PACKAGECONFIG[ssl] = "-DLWS_WITH_SSL=ON,-DLWS_WITH_SSL=OFF,openssl" | ||
PACKAGECONFIG[testapps] = "-DLWS_WITHOUT_TESTAPPS=OFF,-DLWS_WITHOUT_TESTAPPS=ON," | ||
|
||
PACKAGES =+ "${PN}-testapps" | ||
|
||
FILES_${PN}-dev += "${libdir}/cmake" | ||
FILES_${PN}-testapps += "${datadir}/libwebsockets-test-server/*" |
25 changes: 25 additions & 0 deletions
25
meta-venus/recipes-connectivity/mosquitto/files/0001-config.mk-enable-websockets.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 029d6fc74db276b50578b57ee824e3dcd07ad3c5 Mon Sep 17 00:00:00 2001 | ||
From: mpvader <[email protected]> | ||
Date: Fri, 17 Aug 2018 22:03:07 +0200 | ||
Subject: [PATCH] config.mk: enable websockets | ||
|
||
--- | ||
config.mk | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/config.mk b/config.mk | ||
index 71f17e5..eef9c84 100644 | ||
--- a/config.mk | ||
+++ b/config.mk | ||
@@ -65,7 +65,7 @@ WITH_SRV:=yes | ||
WITH_UUID:=yes | ||
|
||
# Build with websockets support on the broker. | ||
-WITH_WEBSOCKETS:=no | ||
+WITH_WEBSOCKETS:=yes | ||
|
||
# Use elliptic keys in broker | ||
WITH_EC:=yes | ||
-- | ||
2.7.4 | ||
|
2 changes: 2 additions & 0 deletions
2
meta-venus/recipes-connectivity/mosquitto/files/mosquitto.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
user mosquitto | ||
port 1883 | ||
listener 9001 | ||
protocol websockets |
5 changes: 5 additions & 0 deletions
5
meta-venus/recipes-connectivity/mosquitto/mosquitto_%.bbappend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters