netutils/libwebsockets: Remove hard-dependency on mbedTLS and enable websoket server#3540
Open
tmedicci wants to merge 4 commits into
Open
netutils/libwebsockets: Remove hard-dependency on mbedTLS and enable websoket server#3540tmedicci wants to merge 4 commits into
tmedicci wants to merge 4 commits into
Conversation
5bbfc3b to
c070277
Compare
libwebsockets can be built without TLS support. To allow this, it was necessary to create a specific Kconfig option that enables TLS support if OPENSSL_MBEDTLS_WRAPPER is enabled. Otherwise, TLS is not supported (but libwebsockets can still be used with plain ws:// connections). Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
This commit enables building libwebsockets server based on a new Kconfig entry. Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
Prior to this change, if an empty folder existed instead of the actual libwebsockets source, the build would fail. This commit checks for an actual file instead, avoid such kind of errors. Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
This commit adds a simple websocket server example that echoes data back to the client using libwebsockets. Signed-off-by: Tiago Medicci <tiago.medicci@espressif.com>
c070277 to
ef9f49f
Compare
xiaoxiang781216
approved these changes
Jun 15, 2026
jerpelea
approved these changes
Jun 16, 2026
eren-terzioglu
approved these changes
Jun 16, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
examples/lws_echo: Add a simple websocket server example
netutils/libwebsockets: Fix error regarding building with CMake
check for an actual file instead, avoid such kind of errors.
netutils/libwebsockets: Enable libwebsockets server
netutils/libwebsockets: Remove hard dependency on mbedTLS
Impact
Impact on user: Yes. Enable using
libwebsocketson simpler applications, including creating a websocket server.Impact on build: Yes. Enable using both CMake and Make build system.
Impact on hardware: No.
Impact on documentation: No.
Impact on security: No.
Impact on compatibility: No.
Testing
This PR can be tested using, for instance,
esp32p4-function-ev-board:ethernetdefconfig using both CMake and Make:Building
CMake-based
Make-based
Running
The test is done by connecting the device to a known network and running the
lws_echoapplication on NuttX and a test script on the host PC:NuttX
Check the serial terminal using
picocom(or any other similar software):Then, on NSH, run
lws_echo &:Host PC
Run the following Python script on the Host PC (adjust the device's IP address set at the
urivar):And run it with:
Results
NuttX
Host PC
The Host PC will echo back the previously sent message: