1d4afb5ceSopenharmony_ci## Secure Streams client C++ API 2d4afb5ceSopenharmony_ci 3d4afb5ceSopenharmony_ciEnable for build by selecting `-DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITH_SECURE_STREAMS_CPP=1` at 4d4afb5ceSopenharmony_cicmake. 5d4afb5ceSopenharmony_ci 6d4afb5ceSopenharmony_ciBecause it's designed for OpenSSL + system trust bundle, the minimal 7d4afb5ceSopenharmony_ciexample minimal-secure-streams-cpp requires `-DLWS_WITH_MINIMAL_EXAMPLES=1 -DLWS_WITH_MBEDTLS=0` 8d4afb5ceSopenharmony_ci 9d4afb5ceSopenharmony_ciBy default the -cpp example downloads https://warmcat.com/test-a.bin to the local 10d4afb5ceSopenharmony_cifile /tmp/test-a.bin. By giving, eg, -c 4, you can run four concurrent downloads of 11d4afb5ceSopenharmony_cifiles test-a.bin through test-d.bin... up to 12 files may be downloaded concurrently. 12d4afb5ceSopenharmony_ci 13d4afb5ceSopenharmony_ciBy default it will connect over h2 and share the single connection between all the 14d4afb5ceSopenharmony_cidownloads. 15d4afb5ceSopenharmony_ci 16d4afb5ceSopenharmony_ci### File level api 17d4afb5ceSopenharmony_ci 18d4afb5ceSopenharmony_ci``` 19d4afb5ceSopenharmony_ci#include <libwebsockets.hxx> 20d4afb5ceSopenharmony_ci 21d4afb5ceSopenharmony_ci... 22d4afb5ceSopenharmony_ci 23d4afb5ceSopenharmony_ci new lssFile(context, "https://warmcat.com/index.html", 24d4afb5ceSopenharmony_ci "/tmp/index.html", lss_completion, 0); 25d4afb5ceSopenharmony_ci``` 26d4afb5ceSopenharmony_ci 27d4afb5ceSopenharmony_ciThis will copy the remote url to the given local file, and call the 28d4afb5ceSopenharmony_cicompletion callback when it has succeeded or failed. 29d4afb5ceSopenharmony_ci 30