zhhyu7 opened a new pull request, #4197: URL: https://github.com/apache/nuttx-apps/pull/4197
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary - CONFIG_NETUTILS_LIBWEBSOCKETS_TEST builds the upstream api-tests (lejp, lws_tokenize, lws_map, lwsac, lws_cache, lecp, lws_dsh, lws_struct_json) and ten HTTP/WebSocket client examples from minimal-examples as NSH applications, in Make and CMake. The two examples that need TLS-only API (http-client-certinfo, http-client-multi) are built only with CONFIG_NETUTILS_LIBWEBSOCKETS_TLS. - Depend on NET_TCPPROTO_OPTIONS: libwebsockets sets TCP_NODELAY on every TCP socket and connection setup fails without it. - With CONFIG_LIBUV, build the libuv event-lib backend so an application can attach libwebsockets to its own uv_loop. - CONFIG_NETUTILS_LIBWEBSOCKETS_CERTS (default /etc/ssl/certs) sets the CA directory, and SSL_CTX_load_verify_file()/_dir() from the OpenSSL-mbedTLS wrapper are used to load it. ## Impact - NETUTILS_LIBWEBSOCKETS now depends on NET_TCPPROTO_OPTIONS instead of NET; configs that enable libwebsockets without it lose the option. - Everything else is opt-in. ## Testing sim:dynconns + NET_TCPPROTO_OPTIONS + NETUTILS_LIBWEBSOCKETS(_TEST) + DEV_URANDOM on the nuttx0 bridge. API self-tests (lejp, lws_tokenize, lws_map, lwsac, lecp, lws_dsh, lws_struct_json in that order; upstream api-test-lejp prints the "lws_struct JSON" banner): ``` [2026/11/30 04:36:20:8875] U: LWS API selftest: lws_struct JSON [2026/11/30 04:36:20:8877] U: Completed: PASS [2026/11/30 04:36:52:5383] U: LWS API selftest: lws_tokenize [2026/11/30 04:36:52:5475] U: Completed: PASS: 18, FAIL: 0 [2026/11/30 04:37:24:2081] U: LWS API selftest: lws_map [2026/11/30 04:37:24:2085] U: Completed: PASS 4 / 4 [2026/11/30 04:37:55:8682] U: LWS API selftest: lwsac [2026/11/30 04:37:55:8684] U: Completed: PASS [2026/11/30 04:38:27:4981] U: LWS API selftest: LECP CBOR parser [2026/11/30 04:38:27:5422] U: Completed: PASS 137 / 137 [2026/11/30 04:39:09:2181] U: LWS API selftest: lws_dsh [2026/11/30 04:39:09:5184] U: Completed: PASS [2026/11/30 04:39:40:7783] U: LWS API selftest: lws_struct JSON [2026/11/30 04:39:40:7822] U: Completed: PASS ``` WebSocket client against an RFC 6455 echo server on the host (10.0.1.1:7681): three text frames received, pings sent back. ``` libwebsockets_test_lws_ws_client -s 10.0.1.1 -p 7681 -n --protocol lws-minimal-client [2026/11/30 04:25:04:7947] U: LWS minimal ws client [2026/11/30 04:25:04:7948] N: lws_create_context: LWS: 4.3.1-unknown, NET CLI H1 H2 WS ConMon IPV6-on ws: handshake [b'lws-minimal-client'] [2026/11/30 04:25:04:8032] U: callback_minimal: established [2026/11/30 04:25:05:0035] N: 0000: 68 65 6C 6C 6F 20 30 20 66 72 6F 6D 20 68 6F 73 hello 0 from hos [2026/11/30 04:25:05:0035] N: 0010: 74 t [2026/11/30 04:25:05:0037] N: 0000: 68 65 6C 6C 6F 20 31 20 66 72 6F 6D 20 68 6F 73 hello 1 from hos [2026/11/30 04:25:05:0038] N: 0010: 74 t [2026/11/30 04:25:05:0040] N: 0000: 68 65 6C 6C 6F 20 32 20 66 72 6F 6D 20 68 6F 73 hello 2 from hos [2026/11/30 04:25:05:0041] N: 0010: 74 t ws: rx op=9 len=0 b'' ws: rx op=9 len=0 b'' ws: rx op=9 len=0 b'' ws: rx op=9 len=0 b'' ``` Builds: Make with TEST on/off and with CONFIG_LIBUV; CMake with NETUTILS_LIBWEBSOCKETS_TEST. checkpatch.sh -c -u -m -g passes for every commit. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
