diff --git a/CMakeLists.txt b/CMakeLists.txt index 3565589f5..e00317bd0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -942,7 +942,7 @@ endif() if (LWS_HAVE_LIBCAP) find_library(LIBCAP_LIBRARIES NAMES cap) - list(APPEND LIB_LIST ${LIBCAP_LIBRARIES} ) + list(APPEND LIB_LIST_AT_END ${LIBCAP_LIBRARIES} ) endif() if (LWS_WITH_PLUGINS_BUILTIN) @@ -1006,7 +1006,10 @@ set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") message("DIR ${libwebsockets_DIR} CMP ${CMAKE_MODULE_PATH}") if (LWS_WITH_MINIMAL_EXAMPLES) - add_subdirectory(minimal-examples) + if (LWS_WITH_SECURE_STREAMS) + add_subdirectory(minimal-examples) + endif() + add_subdirectory(minimal-examples-lowlevel) endif() if (NOT LWS_WITHOUT_TESTAPPS) diff --git a/README.md b/README.md index 552603f38..f44e2e425 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,84 @@ sdevent, glib and uloop, as well as custom event libs. News ---- +## Lws examples switching to Secure Streams + +![Secure Streams direct](./doc-assets/ss-api1.png) + +**Secure Streams** support in lws was introduced a couple of years ago, it's a +higher-level interface to lws `wsi`-level apis that simplifies connectivity by +segregating connection policy like protocol and endpoint information into a +separate [JSON policy file](./minimal-examples/client/hello_world/example-policy.json), and just having the [code deal with payloads](./minimal-examples/clients/hello_world/hello_world-ss.c); as many +details of the wire protocol as possible are hidden or moved to the policy, so +user code is almost identical even if the wire protocol changes. + +The user code just asks to create a SS by "streamtype name", it is created +according to the details (protocol, endpoint, etc) under the same name in the +policy. + +Key policy entries like endpoint can contain `${metadata-name}` string +substitutions to handle runtime adaptations via metadata. h1, h2, ws and mqtt +are supported. + +As a layer on top of the `wsi` apis, SS provides a higher-level way to access +the existing wsi-level capabilities, both kinds of API will remain supported. +Secure Streams are longer-lived than a single wsi, so an SS can coordinate +retries by itself. SS-based user code is typically significantly smaller and +more maintainable than wsi layer. + +In main branch I have moved the older examples into `./minimal-examples-lowlevel` +and am starting to port more cases from there into SS-based examples. + +### Comparison between wsi and SS level lws usage + +|Feature|"low-level" wsi way|Secure Streams way| +|---|---|---| +|Create context|code|same| +|Loop support, sul scheduler|default, event libs|same| +|Supports comms mode|Client, Server, Raw|same| +|Supports protocols|h1, h2, ws, mqtt (client)|same| +|TLS support|mbedtls (including v3), openssl (including v3), wolfssl, boringssl, libressl|same| +|Serializable, proxiable, muxable, transportable|No|Yes| +|Auto-allocated per-connection user object|pss specified in lws_protocols|Specified in ss info struct| +|Connection User API|Protocol-specific lws_protocols cbs (> 100)|SS API (rx, tx, state callbacks only)| +|Sending adaptation|lws_callback_on_writeable() + WRITEABLE|lws_ss_request_write() + tx() cb| +|Sending buffer|User-chosen + malloc'd partial handling|SS-provided, no partials| +|Create vhosts|code|**JSON policy**| +|TLS validation|cert bundle or code|**JSON policy**, or cert bundle| +|Connection retry / backoff|code|**JSON policy**, Auto| +|Nailing up|code|**JSON policy**, Auto| +|Endpoint and protocol details|spread around the code|**JSON policy**| +|Protocol selection, pipeline / stream sharing|code|**JSON policy**| +|ws subprotocol selection|code|**JSON policy**| +|ws binary / text|code|**JSON policy**| +|Protocol-specific metadata|Protocol-specific apis in code (eg, lws_hdr)|**JSON policy**, generic metadata apis in code| +|Connection validity rules|struct|**JSON policy**, Auto| +|Stream as Long Poll|code|**JSON policy**| +|Auth|code|**JSON policy** + automatic rotation if provider supported, else code| + +### Serialized Secure Streams + +![Secure Streams direct](./doc-assets/ss-api2.png) + +Secure Streams APIs are also **serializable**, the exact same client code can +fulfil the connection directly in the same process as you would expect, or +forward the actions, metadata and payloads to an [SS Proxy](./minimal-examples/ssproxy/ssproxy-socket) that owns the policy +over a Unix Domain or TCP socket connection to be fulfilled centrally. This +allows, eg, h2 streams from different processes sharing a single connection. + +![Secure Streams direct](./doc-assets/ss-api3.png) + +The serialized SS can also travel over generic transports like UART, an [example +is provided implementing the Binance example on an RPi Pico](./minimal-examples/embedded/pico/pico-sspc-binance) with a UART transport +to a [UART transport SS proxy](./minimal-examples/ssproxy/ssproxy-custom-transport-uart), where the pico itself has no network stack, tls, compression or +wss stack, but can send and receive to and from the endpoint as if it did. + +The optional `lws_trasport_mux` is used to interpose between the UART transport +and the SSPC layer, allowing a single pipe to carry many separate SS connections. + +The user SS code is identical however it is transported, muxed and fulfilled. + + ## v4.3 is released See the [changelog](https://libwebsockets.org/git/libwebsockets/tree/changelog) diff --git a/READMEs/README.ctest.md b/READMEs/README.ctest.md index 0ed8a8400..9fdb1ee7b 100644 --- a/READMEs/README.ctest.md +++ b/READMEs/README.ctest.md @@ -282,7 +282,7 @@ named fixture "hcm_srv", itself with an 800s timeout ``` set_tests_properties(st_hcm_srv PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-tls + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-tls FIXTURES_SETUP hcm_srv TIMEOUT 800) set_tests_properties(ki_hcm_srv PROPERTIES @@ -296,7 +296,7 @@ test (http-client-multi) we are testing set_tests_properties(http-client-multi PROPERTIES FIXTURES_REQUIRED "hcm_srv" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-multi + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-multi TIMEOUT 50) ``` diff --git a/doc-assets/ss-api1.png b/doc-assets/ss-api1.png new file mode 100644 index 000000000..8acdf065c Binary files /dev/null and b/doc-assets/ss-api1.png differ diff --git a/doc-assets/ss-api2.png b/doc-assets/ss-api2.png new file mode 100644 index 000000000..cf58ba1f8 Binary files /dev/null and b/doc-assets/ss-api2.png differ diff --git a/doc-assets/ss-api3.png b/doc-assets/ss-api3.png new file mode 100644 index 000000000..a23e2e343 Binary files /dev/null and b/doc-assets/ss-api3.png differ diff --git a/include/libwebsockets/lws-context-vhost.h b/include/libwebsockets/lws-context-vhost.h index 2ea966f63..0c91ebe78 100644 --- a/include/libwebsockets/lws-context-vhost.h +++ b/include/libwebsockets/lws-context-vhost.h @@ -1229,6 +1229,19 @@ lws_context_user(struct lws_context *context); LWS_VISIBLE LWS_EXTERN const char * lws_vh_tag(struct lws_vhost *vh); +LWS_VISIBLE LWS_EXTERN void +_lws_context_info_defaults(struct lws_context_creation_info *info, + const char *sspol); + +LWS_VISIBLE LWS_EXTERN void +lws_default_loop_exit(struct lws_context *cx); + +LWS_VISIBLE LWS_EXTERN void +lws_context_default_loop_run_destroy(struct lws_context *cx); + +LWS_VISIBLE LWS_EXTERN int +lws_cmdline_passfail(int argc, const char **argv, int actual); + /** * lws_context_is_being_destroyed() - find out if context is being destroyed * diff --git a/include/libwebsockets/lws-misc.h b/include/libwebsockets/lws-misc.h index 58217e886..2a721421d 100644 --- a/include/libwebsockets/lws-misc.h +++ b/include/libwebsockets/lws-misc.h @@ -886,7 +886,7 @@ LWS_VISIBLE extern const lws_humanize_unit_t humanize_schema_us[8]; void lws_assert_fourcc(uint32_t fourcc, uint32_t expected); #else -#define lws_assert_fourcc(_a, _b) +#define lws_assert_fourcc(_a, _b) do { } while (0); #endif /** diff --git a/include/libwebsockets/lws-secure-streams-client.h b/include/libwebsockets/lws-secure-streams-client.h index 361b980ed..3683d70f9 100644 --- a/include/libwebsockets/lws-secure-streams-client.h +++ b/include/libwebsockets/lws-secure-streams-client.h @@ -66,6 +66,7 @@ struct lws_sspc_handle; #define lws_ss_to_user_object lws_sspc_to_user_object #define lws_ss_change_handlers lws_sspc_change_handlers #define lws_smd_ss_rx_forward lws_smd_sspc_rx_forward +#define lws_ss_server_ack lws_sspc_server_ack #define lws_ss_tag lws_sspc_tag #define _lws_fi_user_ss_fi _lws_fi_user_sspc_fi #define lwsl_ss_get_cx lwsl_sspc_get_cx @@ -349,6 +350,9 @@ LWS_VISIBLE LWS_EXTERN void lws_sspc_change_handlers(struct lws_sspc_handle *h, lws_sscb_rx rx,lws_sscb_tx tx, lws_sscb_state state); +LWS_VISIBLE LWS_EXTERN void +lws_sspc_server_ack(struct lws_sspc_handle *h, int nack); + /* * Helpers offered by lws to handle transport SSPC-side proxy link events diff --git a/include/libwebsockets/lws-secure-streams.h b/include/libwebsockets/lws-secure-streams.h index 4a0aa4448..39fc50e4e 100644 --- a/include/libwebsockets/lws-secure-streams.h +++ b/include/libwebsockets/lws-secure-streams.h @@ -248,6 +248,28 @@ typedef struct lws_ss_info { } lws_ss_info_t; +#define LWS_SS_USER_TYPEDEF \ + typedef struct { \ + struct lws_ss_handle *ss; \ + void *opaque_data; + +#define LWS_SS_INFO(_streamtype, _type) \ + const lws_ss_info_t ssi_##_type = { \ + .handle_offset = offsetof(_type, ss), \ + .opaque_user_data_offset = offsetof(_type, opaque_data), \ + .user_alloc = sizeof(_type), \ + .streamtype = _streamtype, + +#define lws_ss_from_user(_u) (_u)->ss +#define lws_ss_opaque_from_user(_u) (_u)->opaque_data +#define lws_ss_cx_from_user(_u) lws_ss_get_context((_u)->ss) + +#if defined(LWS_SS_USE_SSPC) +#define lws_context_info_defaults(_x, _y) _lws_context_info_defaults(_x, NULL) +#else +#define lws_context_info_defaults(_x, _y) _lws_context_info_defaults(_x, _y) +#endif + /** * lws_ss_create() - Create secure stream * diff --git a/lib/core-net/vhost.c b/lib/core-net/vhost.c index 562607c78..1741f700e 100644 --- a/lib/core-net/vhost.c +++ b/lib/core-net/vhost.c @@ -690,10 +690,10 @@ lws_create_vhost(struct lws_context *context, if (!pcols) { for (vh->count_protocols = 0; info->pprotocols[vh->count_protocols]; - vh->count_protocols++) { - lwsl_user("%s: ppcols: %s\n", __func__, - info->pprotocols[vh->count_protocols]->name); - } + vh->count_protocols++) + ; + //lwsl_user("%s: ppcols: %s\n", __func__, + // info->pprotocols[vh->count_protocols]->name); } else for (vh->count_protocols = 0; pcols[vh->count_protocols].callback; diff --git a/lib/core/libwebsockets.c b/lib/core/libwebsockets.c index 958d843f7..0fd5a8f91 100644 --- a/lib/core/libwebsockets.c +++ b/lib/core/libwebsockets.c @@ -1399,7 +1399,10 @@ static const char * const builtins[] = { "-d", "--fault-injection", "--fault-seed", - "--ignore-sigterm" + "--ignore-sigterm", + "--ssproxy-port", + "--ssproxy-iface", + "--ssproxy-ads", }; enum opts { @@ -1407,6 +1410,9 @@ enum opts { OPT_FAULTINJECTION, OPT_FAULT_SEED, OPT_IGNORE_SIGTERM, + OPT_SSPROXY_PORT, + OPT_SSPROXY_IFACE, + OPT_SSPROXY_ADS, }; #if !defined(LWS_PLAT_FREERTOS) @@ -1416,6 +1422,72 @@ lws_sigterm_catch(int sig) } #endif +void +_lws_context_info_defaults(struct lws_context_creation_info *info, + const char *sspol) +{ + memset(info, 0, sizeof *info); + info->fd_limit_per_thread = 1 + 6 + 1; +#if defined(LWS_WITH_NETWORK) + info->port = CONTEXT_PORT_NO_LISTEN; +#endif +#if defined(LWS_WITH_SECURE_STREAMS) && !defined(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY) + info->pss_policies_json = sspol; +#endif +#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API) + if (!sspol) + info->protocols = lws_sspc_protocols; + else +#endif + info->options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | + LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW | + LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; +} + +void +lws_default_loop_exit(struct lws_context *cx) +{ + if (cx) { + cx->interrupted = 1; +#if defined(LWS_WITH_NETWORK) + lws_cancel_service(cx); +#endif + } +} + +#if defined(LWS_WITH_NETWORK) +void +lws_context_default_loop_run_destroy(struct lws_context *cx) +{ + /* the default event loop, since we didn't provide an alternative one */ + + while (!cx->interrupted && lws_service(cx, 0) >= 0) + ; + + lws_context_destroy(cx); +} +#endif + +int +lws_cmdline_passfail(int argc, const char **argv, int actual) +{ + int expected = 0; + const char *p; + + if ((p = lws_cmdline_option(argc, argv, "--expected-exit"))) + expected = atoi(p); + + if (actual == expected) { + lwsl_user("Completed: OK (seen expected %d)\n", actual); + + return 0; + } + + lwsl_err("Completed: failed: exit %d, expected %d\n", actual, expected); + + return 1; +} + void lws_cmdline_option_handle_builtin(int argc, const char **argv, struct lws_context_creation_info *info) @@ -1438,6 +1510,25 @@ lws_cmdline_option_handle_builtin(int argc, const char **argv, logs = m; break; +#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API) + case OPT_SSPROXY_PORT: + /* connect to ssproxy via UDS by default, else via + * tcp connection to this port */ + info->ss_proxy_port = (uint16_t)atoi(p); + break; + + case OPT_SSPROXY_IFACE: + /* UDS "proxy.ss.lws" in abstract namespace, else this socket + * path; when -p given this can specify the network interface + * to bind to */ + info->ss_proxy_bind = p; + break; + + case OPT_SSPROXY_ADS: + info->ss_proxy_address = p; + break; +#endif + case OPT_FAULTINJECTION: #if !defined(LWS_WITH_SYS_FAULT_INJECTION) lwsl_err("%s: FAULT_INJECTION not built\n", __func__); diff --git a/lib/core/private-lib-core.h b/lib/core/private-lib-core.h index 71ed78038..1914190f7 100644 --- a/lib/core/private-lib-core.h +++ b/lib/core/private-lib-core.h @@ -735,6 +735,7 @@ struct lws_context { char tls_gate_accepts; unsigned int deprecated:1; + unsigned int interrupted:1; unsigned int inside_context_destroy:1; unsigned int being_destroyed:1; unsigned int service_no_longer_possible:1; diff --git a/lib/secure-streams/policy-json.c b/lib/secure-streams/policy-json.c index 3427ae6d4..cf742a2a5 100644 --- a/lib/secure-streams/policy-json.c +++ b/lib/secure-streams/policy-json.c @@ -395,6 +395,7 @@ lws_ss_policy_parser_cb(struct lejp_ctx *ctx, char reason) * The struct *x is in the lwsac... the ca_der it points to * is individually allocated from the heap */ + a->curr[LTY_X509].x->ca_der = lws_malloc((unsigned int)a->count, "ssx509"); if (!a->curr[LTY_X509].x->ca_der) goto oom; @@ -1168,7 +1169,7 @@ lws_ss_policy_parse_abandon(struct lws_context *context) { struct policy_cb_args *args = (struct policy_cb_args *)context->pol_args; lws_ss_x509_t *x; - +lwsl_notice("%s\n", __func__); x = args->heads[LTY_X509].x; while (x) { /* @@ -1206,8 +1207,10 @@ lws_ss_policy_parse_file(struct lws_context *cx, const char *filepath) uint8_t buf[512]; int n, m, fd = lws_open(filepath, LWS_O_RDONLY); - if (fd < 0) + if (fd < 0) { + lwsl_cx_err(cx, "Unable to open policy '%s'", filepath); return LEJP_REJECT_UNKNOWN; + } do { n = (int)read(fd, buf, sizeof(buf)); diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index 73cc25629..9d8e644d8 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -549,7 +549,7 @@ secstream_h1(struct lws *wsi, enum lws_callback_reasons reason, void *user, if (h->ss_dangling_connected) { /* already disconnected, no action for DISCONNECT_ME */ r = lws_ss_event_helper(h, LWSSSCS_DISCONNECTED); - if (r != LWSSSSRET_OK) + if (r == LWSSSSRET_DESTROY_ME) return _lws_ss_handle_state_ret_CAN_DESTROY_HANDLE(r, wsi, &h); } break; @@ -919,7 +919,7 @@ malformed: case LWS_CALLBACK_CLIENT_HTTP_WRITEABLE: if (!h || !h->info.tx) { - lwsl_notice("%s: no handle / tx\n", __func__); + lwsl_debug("%s: no handle / tx\n", __func__); return 0; } diff --git a/lib/secure-streams/secure-streams.c b/lib/secure-streams/secure-streams.c index 4f25a8a51..6bf1964ff 100644 --- a/lib/secure-streams/secure-streams.c +++ b/lib/secure-streams/secure-streams.c @@ -433,6 +433,7 @@ lws_ss_event_helper(lws_ss_handle_t *h, lws_ss_constate_t cs) cs == LWSSSCS_UNREACHABLE && h->wsi && h->wsi->dns_reachability); h->h_in_svc = NULL; + #if defined(LWS_WITH_SERVER) if ((h->info.flags & LWSSSINFLAGS_ACCEPTED) && cs == LWSSSCS_DISCONNECTED) @@ -1502,7 +1503,7 @@ lws_ss_destroy(lws_ss_handle_t **ppss) #endif #if defined(LWS_WITH_SERVER) - if (v) + if (v && (h->info.flags & LWSSSINFLAGS_SERVER)) /* * For server, the policy describes a vhost that implements the * server, when we take down the ss, we take down the related diff --git a/lib/secure-streams/serialized/client/sspc-transport.c b/lib/secure-streams/serialized/client/sspc-transport.c index 9fe4b34e3..a689b8974 100644 --- a/lib/secure-streams/serialized/client/sspc-transport.c +++ b/lib/secure-streams/serialized/client/sspc-transport.c @@ -173,9 +173,6 @@ lws_sspc_txp_event_closed(lws_transport_priv_t priv) lws_sspc_handle_t *h = (lws_sspc_handle_t *)priv; lws_ss_state_return_t r = LWSSSSRET_OK; - - lwsl_sspc_notice(h, "entry"); - if (!h) { lwsl_sspc_info(h, "No sspc on client proxy link close"); return LWSSSSRET_OK; @@ -275,7 +272,7 @@ lws_sspc_txp_tx(lws_sspc_handle_t *h, size_t metadata_limit) * We are negotating the opening of a particular * streamtype */ - lwsl_sspc_notice(h, "LPCSCLI_SENDING_INITIAL_TX"); + // lwsl_sspc_notice(h, "LPCSCLI_SENDING_INITIAL_TX"); txl = strlen(h->ssi.streamtype) + 1 + 4 + 4; cp = s; @@ -297,7 +294,7 @@ lws_sspc_txp_tx(lws_sspc_handle_t *h, size_t metadata_limit) case LPCSCLI_LOCAL_CONNECTED: - lwsl_sspc_notice(h, "LPCSCLI_LOCAL_CONNECTED"); + // lwsl_sspc_notice(h, "LPCSCLI_LOCAL_CONNECTED"); /* * Do we need to prioritize sending any metadata diff --git a/lib/secure-streams/serialized/client/sspc.c b/lib/secure-streams/serialized/client/sspc.c index 1f454ec28..8586615c9 100644 --- a/lib/secure-streams/serialized/client/sspc.c +++ b/lib/secure-streams/serialized/client/sspc.c @@ -339,8 +339,8 @@ lws_sspc_create(struct lws_context *context, int tsi, const lws_ss_info_t *ssi, /* priv_onw filled in by onw transport */ - lwsl_sspc_notice(h, "txp path %s -> %s", h->txp_path.ops_in->name, - h->txp_path.ops_onw->name); + lwsl_sspc_info(h, "txp path %s -> %s", h->txp_path.ops_in->name, + h->txp_path.ops_onw->name); memcpy(&h->ssi, ssi, sizeof(*ssi)); ua = (uint8_t *)&h[1]; @@ -502,7 +502,7 @@ lws_sspc_request_tx(lws_sspc_handle_t *h) if (!h->us_earliest_write_req) h->us_earliest_write_req = lws_now_usecs(); - lwsl_notice("%s: state %u, conn_req_state %u\n", __func__, + lwsl_info("%s: state %u, conn_req_state %u\n", __func__, (unsigned int)h->state, (unsigned int)h->conn_req_state); @@ -697,6 +697,14 @@ _lws_sspc_set_metadata(struct lws_sspc_handle *h, const char *name, return 0; } +void +lws_sspc_server_ack(struct lws_sspc_handle *h, int nack) +{ + //h->txn_resp = nack; + //h->txn_resp_set = 1; + +} + int lws_sspc_set_metadata(struct lws_sspc_handle *h, const char *name, const void *value, size_t len) diff --git a/lib/tls/tls-network.c b/lib/tls/tls-network.c index b2038d537..8c9448fc1 100644 --- a/lib/tls/tls-network.c +++ b/lib/tls/tls-network.c @@ -201,11 +201,11 @@ lws_gate_accepts(struct lws_context *context, int on) { struct lws_vhost *v = context->vhost_list; - lwsl_notice("%s: on = %d\n", __func__, on); - if (context->tls_gate_accepts == (char)on) return 0; + lwsl_notice("%s: on = %d\n", __func__, on); + context->tls_gate_accepts = (char)on; while (v) { diff --git a/minimal-examples-lowlevel/CMakeLists.txt b/minimal-examples-lowlevel/CMakeLists.txt new file mode 100644 index 000000000..54696b5c8 --- /dev/null +++ b/minimal-examples-lowlevel/CMakeLists.txt @@ -0,0 +1,50 @@ +# +# libwebsockets - small server side websockets and web server implementation +# +# Copyright (C) 2010 - 2021 Andy Green +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. + +MACRO(SUBDIRLIST result curdir) + FILE(GLOB children RELATIVE ${curdir} ${curdir}/*) + SET(dirlist "") + + FOREACH(child ${children}) + IF (IS_DIRECTORY ${curdir}/${child}) + LIST(APPEND dirlist ${child}) + ENDIF() + ENDFOREACH() + + SET(${result} ${dirlist}) +ENDMACRO() + +include_directories(${LWS_LIB_BUILD_INC_PATHS}) +link_libraries(${LIB_LIST_AT_END}) + +SUBDIRLIST(SUBDIRS "${PROJECT_SOURCE_DIR}/minimal-examples-lowlevel") +FOREACH(subdir ${SUBDIRS}) + + SUBDIRLIST(SUBDIRS2 "${PROJECT_SOURCE_DIR}/minimal-examples-lowlevel/${subdir}") + FOREACH(subdir2 ${SUBDIRS2}) + if (EXISTS "${PROJECT_SOURCE_DIR}/minimal-examples-lowlevel/${subdir}/${subdir2}/CMakeLists.txt") + message("Processing ${PROJECT_SOURCE_DIR}/minimal-examples-lowlevel/${subdir}/${subdir2}") + add_subdirectory("${PROJECT_SOURCE_DIR}/minimal-examples-lowlevel/${subdir}/${subdir2}") + endif() + ENDFOREACH() +ENDFOREACH() diff --git a/minimal-examples-lowlevel/README.md b/minimal-examples-lowlevel/README.md new file mode 100644 index 000000000..97d988131 --- /dev/null +++ b/minimal-examples-lowlevel/README.md @@ -0,0 +1,100 @@ +## minimal-examples-lowlevel + +These are the traditional lws low-level, wsi-based examples. + +`./minimal-examples` contains higher-level, Secure Stream based examples for a +growing subset of these cases. New users may find it easier to use those higher- +level examples for the (common) cases they cover. + +These lowlevel apis are not going anywhere, the higher level stuff uses them +to get stuff done itself. + +|name|demonstrates| +---|--- +client-server|Minimal examples providing client and server connections simultaneously +crypto|Minimal examples related to using lws crypto apis +dbus-server|Minimal examples showing how to integrate DBUS into lws event loop +http-client|Minimal examples providing an http client +http-server|Minimal examples providing an http server +raw|Minimal examples related to adopting raw file or socket descriptors into the event loop +secure-streams|Minimal examples related to the Secure Streams client api +ws-client|Minimal examples providing a ws client +ws-server|Minimal examples providing a ws server (and an http server) + +## FAQ + +### Getting started + +Build and install lws itself first (note that after installing lws on \*nix, you need to run `ldconfig` one time so the OS can learn about the new library. Lws installs in `/usr/local` by default, Debian / Ubuntu ldconfig knows to look there already, but Fedora / CentOS need you to add the line `/usr/local/lib` to `/etc/ld.so.conf` and run ldconfig) + +Then start with the simplest: + +`http-server/minimal-http-server` + +### Why are most of the sources split into a main C file file and a protocol file? + +Lws supports three ways to implement the protocol callback code: + + - you can just add it all in the same source file + + - you can separate it as these examples do, and #include it + into the main sources + + - you can build it as a standalone plugin that is discovered + and loaded at runtime. + +The way these examples are structured, you can easily also build +the protocol callback as a plugin just with a different +CMakeLists.txt... see https://github.com/warmcat/libwebsockets/tree/master/plugin-standalone +for an example. + +### Why would we want the protocol as a plugin? + +You will notice a lot of the main C code is the same boilerplate +repeated for each example. The actual interesting part is in +the protocol callback only. + +Lws provides (-DLWS_WITH_LWSWS=1) a generic lightweight server app called 'lwsws' that +can be configured by JSON. Combined with your protocol as a plugin, +it means you don't actually have to make a special server "app" +part, you can just use lwsws and pass per-vhost configuration +from JSON into your protocol. (Of course in some cases you have +an existing app you are bolting lws on to, then you don't care +about this for that particular case). + +Because lwsws has no dependency on whatever your plugin does, it +can mix and match different protocols randomly without needing any code +changes. It reduces the size of the task to just writing the +code you care about in your protocol handler, and nothing else to write +or maintain. + +Lwsws supports advanced features like reload, where it starts a new server +instance with changed config or different plugins, while keeping the old +instance around until the last connection to it closes. + +### I get why there is a pss, but why is there a vhd? + +The pss is instantiated per-connection. But there are almost always +other variables that have a lifetime longer than a single connection. + +You could make these variables "filescope" one-time globals, but that +means your protocol cannot instantiate multiple times. + +Lws supports vhosts (virtual hosts), for example both https://warmcat.com +and https://libwebsockets are running on the same lwsws instance on the +same server and same IP... each of these is a separate vhost. + +Your protocol may be enabled on multiple vhosts, each of these vhosts +provides a different vhd specific to the protocol instance on that +vhost. For example many of the samples keep a linked-list head to +a list of live pss in the vhd... that means it's cleanly a list of +pss opened **on that vhost**. If another vhost has the protocol +enabled, connections to that will point to a different vhd, and the +linked-list head on that vhd will only list connections to his vhost. + +The example "ws-server/minimal-ws-server-threads" demonstrates how to deliver +external configuration data to a specific vhost + protocol +combination using code. In lwsws, this is simply a matter of setting +the desired JSON config. + + diff --git a/minimal-examples/abstract/protocols/smtp-client/CMakeLists.txt b/minimal-examples-lowlevel/abstract/protocols/smtp-client/CMakeLists.txt similarity index 100% rename from minimal-examples/abstract/protocols/smtp-client/CMakeLists.txt rename to minimal-examples-lowlevel/abstract/protocols/smtp-client/CMakeLists.txt diff --git a/minimal-examples/abstract/protocols/smtp-client/README.md b/minimal-examples-lowlevel/abstract/protocols/smtp-client/README.md similarity index 100% rename from minimal-examples/abstract/protocols/smtp-client/README.md rename to minimal-examples-lowlevel/abstract/protocols/smtp-client/README.md diff --git a/minimal-examples/abstract/protocols/smtp-client/main.c b/minimal-examples-lowlevel/abstract/protocols/smtp-client/main.c similarity index 100% rename from minimal-examples/abstract/protocols/smtp-client/main.c rename to minimal-examples-lowlevel/abstract/protocols/smtp-client/main.c diff --git a/minimal-examples/api-tests/README.md b/minimal-examples-lowlevel/api-tests/README.md similarity index 100% rename from minimal-examples/api-tests/README.md rename to minimal-examples-lowlevel/api-tests/README.md diff --git a/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-async-dns/CMakeLists.txt similarity index 89% rename from minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-async-dns/CMakeLists.txt index 256726ca1..6deade98c 100644 --- a/minimal-examples/api-tests/api-test-async-dns/CMakeLists.txt +++ b/minimal-examples-lowlevel/api-tests/api-test-async-dns/CMakeLists.txt @@ -18,7 +18,7 @@ if (requirements) add_test(NAME api-test-async-dns COMMAND lws-api-test-async-dns) set_tests_properties(api-test-async-dns PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/api-tests/api-test-async-dns + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/api-tests/api-test-async-dns TIMEOUT 60) if (websockets_shared) diff --git a/minimal-examples/api-tests/api-test-async-dns/main.c b/minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-async-dns/main.c rename to minimal-examples-lowlevel/api-tests/api-test-async-dns/main.c diff --git a/minimal-examples/api-tests/api-test-cose/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-cose/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-cose/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-cose/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-cose/README.md b/minimal-examples-lowlevel/api-tests/api-test-cose/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-cose/README.md rename to minimal-examples-lowlevel/api-tests/api-test-cose/README.md diff --git a/minimal-examples/api-tests/api-test-cose/keys.c b/minimal-examples-lowlevel/api-tests/api-test-cose/keys.c similarity index 100% rename from minimal-examples/api-tests/api-test-cose/keys.c rename to minimal-examples-lowlevel/api-tests/api-test-cose/keys.c diff --git a/minimal-examples/api-tests/api-test-cose/main.c b/minimal-examples-lowlevel/api-tests/api-test-cose/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-cose/main.c rename to minimal-examples-lowlevel/api-tests/api-test-cose/main.c diff --git a/minimal-examples/api-tests/api-test-cose/sign.c b/minimal-examples-lowlevel/api-tests/api-test-cose/sign.c similarity index 100% rename from minimal-examples/api-tests/api-test-cose/sign.c rename to minimal-examples-lowlevel/api-tests/api-test-cose/sign.c diff --git a/minimal-examples/api-tests/api-test-dhcpc/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-dhcpc/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-dhcpc/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-dhcpc/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-dhcpc/README.md b/minimal-examples-lowlevel/api-tests/api-test-dhcpc/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-dhcpc/README.md rename to minimal-examples-lowlevel/api-tests/api-test-dhcpc/README.md diff --git a/minimal-examples/api-tests/api-test-dhcpc/main.c b/minimal-examples-lowlevel/api-tests/api-test-dhcpc/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-dhcpc/main.c rename to minimal-examples-lowlevel/api-tests/api-test-dhcpc/main.c diff --git a/minimal-examples/api-tests/api-test-fts/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-fts/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-fts/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-fts/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-fts/README.md b/minimal-examples-lowlevel/api-tests/api-test-fts/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-fts/README.md rename to minimal-examples-lowlevel/api-tests/api-test-fts/README.md diff --git a/minimal-examples/api-tests/api-test-fts/canned-1.txt b/minimal-examples-lowlevel/api-tests/api-test-fts/canned-1.txt similarity index 100% rename from minimal-examples/api-tests/api-test-fts/canned-1.txt rename to minimal-examples-lowlevel/api-tests/api-test-fts/canned-1.txt diff --git a/minimal-examples/api-tests/api-test-fts/canned-2.txt b/minimal-examples-lowlevel/api-tests/api-test-fts/canned-2.txt similarity index 100% rename from minimal-examples/api-tests/api-test-fts/canned-2.txt rename to minimal-examples-lowlevel/api-tests/api-test-fts/canned-2.txt diff --git a/minimal-examples/api-tests/api-test-fts/les-mis-utf8.txt b/minimal-examples-lowlevel/api-tests/api-test-fts/les-mis-utf8.txt similarity index 100% rename from minimal-examples/api-tests/api-test-fts/les-mis-utf8.txt rename to minimal-examples-lowlevel/api-tests/api-test-fts/les-mis-utf8.txt diff --git a/minimal-examples/api-tests/api-test-fts/main.c b/minimal-examples-lowlevel/api-tests/api-test-fts/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-fts/main.c rename to minimal-examples-lowlevel/api-tests/api-test-fts/main.c diff --git a/minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt b/minimal-examples-lowlevel/api-tests/api-test-fts/the-picture-of-dorian-gray.txt similarity index 100% rename from minimal-examples/api-tests/api-test-fts/the-picture-of-dorian-gray.txt rename to minimal-examples-lowlevel/api-tests/api-test-fts/the-picture-of-dorian-gray.txt diff --git a/minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-gencrypto/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-gencrypto/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-gencrypto/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-gencrypto/README.md b/minimal-examples-lowlevel/api-tests/api-test-gencrypto/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-gencrypto/README.md rename to minimal-examples-lowlevel/api-tests/api-test-gencrypto/README.md diff --git a/minimal-examples/api-tests/api-test-gencrypto/lws-genaes.c b/minimal-examples-lowlevel/api-tests/api-test-gencrypto/lws-genaes.c similarity index 100% rename from minimal-examples/api-tests/api-test-gencrypto/lws-genaes.c rename to minimal-examples-lowlevel/api-tests/api-test-gencrypto/lws-genaes.c diff --git a/minimal-examples/api-tests/api-test-gencrypto/lws-genec.c b/minimal-examples-lowlevel/api-tests/api-test-gencrypto/lws-genec.c similarity index 100% rename from minimal-examples/api-tests/api-test-gencrypto/lws-genec.c rename to minimal-examples-lowlevel/api-tests/api-test-gencrypto/lws-genec.c diff --git a/minimal-examples/api-tests/api-test-gencrypto/main.c b/minimal-examples-lowlevel/api-tests/api-test-gencrypto/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-gencrypto/main.c rename to minimal-examples-lowlevel/api-tests/api-test-gencrypto/main.c diff --git a/minimal-examples/api-tests/api-test-jose/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-jose/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-jose/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-jose/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-jose/README.md b/minimal-examples-lowlevel/api-tests/api-test-jose/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-jose/README.md rename to minimal-examples-lowlevel/api-tests/api-test-jose/README.md diff --git a/minimal-examples/api-tests/api-test-jose/jwe.c b/minimal-examples-lowlevel/api-tests/api-test-jose/jwe.c similarity index 100% rename from minimal-examples/api-tests/api-test-jose/jwe.c rename to minimal-examples-lowlevel/api-tests/api-test-jose/jwe.c diff --git a/minimal-examples/api-tests/api-test-jose/jwk.c b/minimal-examples-lowlevel/api-tests/api-test-jose/jwk.c similarity index 100% rename from minimal-examples/api-tests/api-test-jose/jwk.c rename to minimal-examples-lowlevel/api-tests/api-test-jose/jwk.c diff --git a/minimal-examples/api-tests/api-test-jose/jws.c b/minimal-examples-lowlevel/api-tests/api-test-jose/jws.c similarity index 100% rename from minimal-examples/api-tests/api-test-jose/jws.c rename to minimal-examples-lowlevel/api-tests/api-test-jose/jws.c diff --git a/minimal-examples/api-tests/api-test-jose/main.c b/minimal-examples-lowlevel/api-tests/api-test-jose/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-jose/main.c rename to minimal-examples-lowlevel/api-tests/api-test-jose/main.c diff --git a/minimal-examples/api-tests/api-test-lecp/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lecp/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lecp/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lecp/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lecp/README.md b/minimal-examples-lowlevel/api-tests/api-test-lecp/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lecp/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lecp/README.md diff --git a/minimal-examples/api-tests/api-test-lecp/main.c b/minimal-examples-lowlevel/api-tests/api-test-lecp/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lecp/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lecp/main.c diff --git a/minimal-examples/api-tests/api-test-lejp/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lejp/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lejp/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lejp/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lejp/main.c b/minimal-examples-lowlevel/api-tests/api-test-lejp/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lejp/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lejp/main.c diff --git a/minimal-examples/api-tests/api-test-lws_cache/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_cache/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_cache/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_cache/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_cache/README.md b/minimal-examples-lowlevel/api-tests/api-test-lws_cache/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lws_cache/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lws_cache/README.md diff --git a/minimal-examples/api-tests/api-test-lws_cache/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_cache/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_cache/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_cache/main.c diff --git a/minimal-examples/api-tests/api-test-lws_cache/text1.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_cache/text1.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_cache/text1.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_cache/text1.txt diff --git a/minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_dsh/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_dsh/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_dsh/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_dsh/README.md b/minimal-examples-lowlevel/api-tests/api-test-lws_dsh/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lws_dsh/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lws_dsh/README.md diff --git a/minimal-examples/api-tests/api-test-lws_dsh/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_dsh/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_dsh/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_dsh/main.c diff --git a/minimal-examples/api-tests/api-test-lws_map/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_map/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_map/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_map/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_map/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_map/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_map/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_map/main.c diff --git a/minimal-examples/api-tests/api-test-lws_sequencer/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_sequencer/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_sequencer/libwebsockets.org.cer b/minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/libwebsockets.org.cer similarity index 100% rename from minimal-examples/api-tests/api-test-lws_sequencer/libwebsockets.org.cer rename to minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/libwebsockets.org.cer diff --git a/minimal-examples/api-tests/api-test-lws_sequencer/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_sequencer/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_sequencer/main.c diff --git a/minimal-examples/api-tests/api-test-lws_smd/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_smd/CMakeLists.txt similarity index 90% rename from minimal-examples/api-tests/api-test-lws_smd/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_smd/CMakeLists.txt index e2827064c..492636274 100644 --- a/minimal-examples/api-tests/api-test-lws_smd/CMakeLists.txt +++ b/minimal-examples-lowlevel/api-tests/api-test-lws_smd/CMakeLists.txt @@ -16,7 +16,7 @@ if (requirements) set_tests_properties(api-test-lws_smd PROPERTIES RUN_SERIAL TRUE - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/api-tests/api-test-lws_smd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/api-tests/api-test-lws_smd TIMEOUT 60) if (websockets_shared) diff --git a/minimal-examples/api-tests/api-test-lws_smd/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_smd/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_smd/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_smd/main.c diff --git a/minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct-json/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_struct-json/README.md b/minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct-json/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/README.md diff --git a/minimal-examples/api-tests/api-test-lws_struct-json/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct-json/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/main.c diff --git a/minimal-examples/api-tests/api-test-lws_struct-json/test2.c b/minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/test2.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct-json/test2.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct-json/test2.c diff --git a/minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_struct_sqlite/README.md b/minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct_sqlite/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/README.md diff --git a/minimal-examples/api-tests/api-test-lws_struct_sqlite/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_struct_sqlite/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_struct_sqlite/main.c diff --git a/minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lws_tokenize/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lws_tokenize/README.md b/minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lws_tokenize/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/README.md diff --git a/minimal-examples/api-tests/api-test-lws_tokenize/main.c b/minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lws_tokenize/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lws_tokenize/main.c diff --git a/minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-lwsac/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-lwsac/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-lwsac/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-lwsac/README.md b/minimal-examples-lowlevel/api-tests/api-test-lwsac/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-lwsac/README.md rename to minimal-examples-lowlevel/api-tests/api-test-lwsac/README.md diff --git a/minimal-examples/api-tests/api-test-lwsac/main.c b/minimal-examples-lowlevel/api-tests/api-test-lwsac/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-lwsac/main.c rename to minimal-examples-lowlevel/api-tests/api-test-lwsac/main.c diff --git a/minimal-examples/api-tests/api-test-secure-streams/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-secure-streams/CMakeLists.txt similarity index 89% rename from minimal-examples/api-tests/api-test-secure-streams/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-secure-streams/CMakeLists.txt index b4f39caac..3c24f6de7 100644 --- a/minimal-examples/api-tests/api-test-secure-streams/CMakeLists.txt +++ b/minimal-examples-lowlevel/api-tests/api-test-secure-streams/CMakeLists.txt @@ -17,7 +17,7 @@ if (requirements) add_test(NAME api-test-secure-streams COMMAND ${PROJECT_NAME}) set_tests_properties(api-test-secure-streams PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/api-tests/api-test-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/api-tests/api-test-secure-streams TIMEOUT 20) endif() diff --git a/minimal-examples/api-tests/api-test-secure-streams/README.md b/minimal-examples-lowlevel/api-tests/api-test-secure-streams/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-secure-streams/README.md rename to minimal-examples-lowlevel/api-tests/api-test-secure-streams/README.md diff --git a/minimal-examples/api-tests/api-test-secure-streams/main.c b/minimal-examples-lowlevel/api-tests/api-test-secure-streams/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-secure-streams/main.c rename to minimal-examples-lowlevel/api-tests/api-test-secure-streams/main.c diff --git a/minimal-examples/api-tests/api-test-smtp_client/CMakeLists.txt b/minimal-examples-lowlevel/api-tests/api-test-smtp_client/CMakeLists.txt similarity index 100% rename from minimal-examples/api-tests/api-test-smtp_client/CMakeLists.txt rename to minimal-examples-lowlevel/api-tests/api-test-smtp_client/CMakeLists.txt diff --git a/minimal-examples/api-tests/api-test-smtp_client/README.md b/minimal-examples-lowlevel/api-tests/api-test-smtp_client/README.md similarity index 100% rename from minimal-examples/api-tests/api-test-smtp_client/README.md rename to minimal-examples-lowlevel/api-tests/api-test-smtp_client/README.md diff --git a/minimal-examples/api-tests/api-test-smtp_client/main.c b/minimal-examples-lowlevel/api-tests/api-test-smtp_client/main.c similarity index 100% rename from minimal-examples/api-tests/api-test-smtp_client/main.c rename to minimal-examples-lowlevel/api-tests/api-test-smtp_client/main.c diff --git a/minimal-examples/client-server/README.md b/minimal-examples-lowlevel/client-server/README.md similarity index 100% rename from minimal-examples/client-server/README.md rename to minimal-examples-lowlevel/client-server/README.md diff --git a/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/CMakeLists.txt diff --git a/minimal-examples/client-server/minimal-ws-proxy/README.md b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/README.md similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/README.md rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/README.md diff --git a/minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/minimal-ws-proxy.c rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/minimal-ws-proxy.c diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/example.js similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/mount-origin/example.js rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/example.js diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/favicon.ico b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/mount-origin/favicon.ico rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/favicon.ico diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/index.html b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/index.html similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/mount-origin/index.html rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/index.html diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/client-server/minimal-ws-proxy/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/mount-origin/strict-csp.svg diff --git a/minimal-examples/client-server/minimal-ws-proxy/protocol_lws_minimal.c b/minimal-examples-lowlevel/client-server/minimal-ws-proxy/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/client-server/minimal-ws-proxy/protocol_lws_minimal.c rename to minimal-examples-lowlevel/client-server/minimal-ws-proxy/protocol_lws_minimal.c diff --git a/minimal-examples/crypto/README.md b/minimal-examples-lowlevel/crypto/README.md similarity index 100% rename from minimal-examples/crypto/README.md rename to minimal-examples-lowlevel/crypto/README.md diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/CMakeLists.txt similarity index 95% rename from minimal-examples/crypto/minimal-crypto-cose-key/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/CMakeLists.txt index 6ee78ae99..4551ef10e 100644 --- a/minimal-examples/crypto/minimal-crypto-cose-key/CMakeLists.txt +++ b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/CMakeLists.txt @@ -39,7 +39,7 @@ if (requirements) crypto-cose-key-7 PROPERTIES WORKING_DIRECTORY - ${CMAKE_SOURCE_DIR}/minimal-examples/crypto/minimal-crypto-cose-key + ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key TIMEOUT 5) set_tests_properties(crypto-cose-key-7 diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/README.md diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/main.c diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/set1.cks b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/set1.cks similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/set1.cks rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/set1.cks diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass01.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass01.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass01.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass01.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass02.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass02.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass02.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass02.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass03.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass03.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign1_pass03.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign1_pass03.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign_pass01.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass01.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign_pass01.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass01.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign_pass02.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass02.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign_pass02.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass02.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-key/sign_pass03.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass03.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-key/sign_pass03.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-key/sign_pass03.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/CMakeLists.txt similarity index 98% rename from minimal-examples/crypto/minimal-crypto-cose-sign/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/CMakeLists.txt index b49b4173e..241490e81 100644 --- a/minimal-examples/crypto/minimal-crypto-cose-sign/CMakeLists.txt +++ b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/CMakeLists.txt @@ -207,7 +207,7 @@ if (requirements) PROPERTIES WORKING_DIRECTORY - ${CMAKE_SOURCE_DIR}/minimal-examples/crypto/minimal-crypto-cose-sign + ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign TIMEOUT 5) if (websockets_shared) diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/README.md diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/main.c diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/payload.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/payload.txt similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/payload.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/payload.txt diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/rsa-4096.ck b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/rsa-4096.ck similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/rsa-4096.ck rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/rsa-4096.ck diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/set1.cks b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/set1.cks similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/set1.cks rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/set1.cks diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign-rsa4096.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign-rsa4096.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign-rsa4096.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign-rsa4096.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass01.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass01.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass01.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass01.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass02.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass02.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass02.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass02.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass03.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass03.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign1_pass03.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign1_pass03.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass01.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass01.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass01.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass01.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass02.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass02.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass02.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass02.sig diff --git a/minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass03.sig b/minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass03.sig similarity index 100% rename from minimal-examples/crypto/minimal-crypto-cose-sign/sign_pass03.sig rename to minimal-examples-lowlevel/crypto/minimal-crypto-cose-sign/sign_pass03.sig diff --git a/minimal-examples/crypto/minimal-crypto-jwe/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-jwe/CMakeLists.txt similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwe/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwe/CMakeLists.txt diff --git a/minimal-examples/crypto/minimal-crypto-jwe/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-jwe/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwe/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwe/README.md diff --git a/minimal-examples/crypto/minimal-crypto-jwe/key-rsa-4096.private b/minimal-examples-lowlevel/crypto/minimal-crypto-jwe/key-rsa-4096.private similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwe/key-rsa-4096.private rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwe/key-rsa-4096.private diff --git a/minimal-examples/crypto/minimal-crypto-jwe/key-rsa-4096.pub b/minimal-examples-lowlevel/crypto/minimal-crypto-jwe/key-rsa-4096.pub similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwe/key-rsa-4096.pub rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwe/key-rsa-4096.pub diff --git a/minimal-examples/crypto/minimal-crypto-jwe/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-jwe/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwe/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwe/main.c diff --git a/minimal-examples/crypto/minimal-crypto-jwk/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-jwk/CMakeLists.txt similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwk/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwk/CMakeLists.txt diff --git a/minimal-examples/crypto/minimal-crypto-jwk/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-jwk/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwk/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwk/README.md diff --git a/minimal-examples/crypto/minimal-crypto-jwk/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-jwk/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jwk/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-jwk/main.c diff --git a/minimal-examples/crypto/minimal-crypto-jws/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-jws/CMakeLists.txt similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jws/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-jws/CMakeLists.txt diff --git a/minimal-examples/crypto/minimal-crypto-jws/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-jws/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jws/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-jws/README.md diff --git a/minimal-examples/crypto/minimal-crypto-jws/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-jws/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-jws/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-jws/main.c diff --git a/minimal-examples/crypto/minimal-crypto-x509/CMakeLists.txt b/minimal-examples-lowlevel/crypto/minimal-crypto-x509/CMakeLists.txt similarity index 100% rename from minimal-examples/crypto/minimal-crypto-x509/CMakeLists.txt rename to minimal-examples-lowlevel/crypto/minimal-crypto-x509/CMakeLists.txt diff --git a/minimal-examples/crypto/minimal-crypto-x509/README.md b/minimal-examples-lowlevel/crypto/minimal-crypto-x509/README.md similarity index 100% rename from minimal-examples/crypto/minimal-crypto-x509/README.md rename to minimal-examples-lowlevel/crypto/minimal-crypto-x509/README.md diff --git a/minimal-examples/crypto/minimal-crypto-x509/main.c b/minimal-examples-lowlevel/crypto/minimal-crypto-x509/main.c similarity index 100% rename from minimal-examples/crypto/minimal-crypto-x509/main.c rename to minimal-examples-lowlevel/crypto/minimal-crypto-x509/main.c diff --git a/minimal-examples/dbus-client/README.md b/minimal-examples-lowlevel/dbus-client/README.md similarity index 100% rename from minimal-examples/dbus-client/README.md rename to minimal-examples-lowlevel/dbus-client/README.md diff --git a/minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt b/minimal-examples-lowlevel/dbus-client/minimal-dbus-client/CMakeLists.txt similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-client/CMakeLists.txt rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-client/CMakeLists.txt diff --git a/minimal-examples/dbus-client/minimal-dbus-client/README.md b/minimal-examples-lowlevel/dbus-client/minimal-dbus-client/README.md similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-client/README.md rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-client/README.md diff --git a/minimal-examples/dbus-client/minimal-dbus-client/minimal-dbus-client.c b/minimal-examples-lowlevel/dbus-client/minimal-dbus-client/minimal-dbus-client.c similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-client/minimal-dbus-client.c rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-client/minimal-dbus-client.c diff --git a/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt b/minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/CMakeLists.txt diff --git a/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/README.md b/minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/README.md similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/README.md rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/README.md diff --git a/minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/minimal-dbus-ws-proxy-testclient.c b/minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/minimal-dbus-ws-proxy-testclient.c similarity index 100% rename from minimal-examples/dbus-client/minimal-dbus-ws-proxy-testclient/minimal-dbus-ws-proxy-testclient.c rename to minimal-examples-lowlevel/dbus-client/minimal-dbus-ws-proxy-testclient/minimal-dbus-ws-proxy-testclient.c diff --git a/minimal-examples/dbus-server/README.md b/minimal-examples-lowlevel/dbus-server/README.md similarity index 100% rename from minimal-examples/dbus-server/README.md rename to minimal-examples-lowlevel/dbus-server/README.md diff --git a/minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt b/minimal-examples-lowlevel/dbus-server/minimal-dbus-server/CMakeLists.txt similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-server/CMakeLists.txt rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-server/CMakeLists.txt diff --git a/minimal-examples/dbus-server/minimal-dbus-server/README.md b/minimal-examples-lowlevel/dbus-server/minimal-dbus-server/README.md similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-server/README.md rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-server/README.md diff --git a/minimal-examples/dbus-server/minimal-dbus-server/main.c b/minimal-examples-lowlevel/dbus-server/minimal-dbus-server/main.c similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-server/main.c rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-server/main.c diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt b/minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/CMakeLists.txt diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/README.md b/minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/README.md similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-ws-proxy/README.md rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/README.md diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c b/minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/main.c similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-ws-proxy/main.c rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/main.c diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/org.libwebsockets.wsclientproxy.conf b/minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/org.libwebsockets.wsclientproxy.conf similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-ws-proxy/org.libwebsockets.wsclientproxy.conf rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/org.libwebsockets.wsclientproxy.conf diff --git a/minimal-examples/dbus-server/minimal-dbus-ws-proxy/protocol_lws_minimal_dbus_ws_proxy.c b/minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/protocol_lws_minimal_dbus_ws_proxy.c similarity index 100% rename from minimal-examples/dbus-server/minimal-dbus-ws-proxy/protocol_lws_minimal_dbus_ws_proxy.c rename to minimal-examples-lowlevel/dbus-server/minimal-dbus-ws-proxy/protocol_lws_minimal_dbus_ws_proxy.c diff --git a/minimal-examples/gtk/minimal-gtk/CMakeLists.txt b/minimal-examples-lowlevel/gtk/minimal-gtk/CMakeLists.txt similarity index 100% rename from minimal-examples/gtk/minimal-gtk/CMakeLists.txt rename to minimal-examples-lowlevel/gtk/minimal-gtk/CMakeLists.txt diff --git a/minimal-examples/gtk/minimal-gtk/README.md b/minimal-examples-lowlevel/gtk/minimal-gtk/README.md similarity index 100% rename from minimal-examples/gtk/minimal-gtk/README.md rename to minimal-examples-lowlevel/gtk/minimal-gtk/README.md diff --git a/minimal-examples/gtk/minimal-gtk/main.c b/minimal-examples-lowlevel/gtk/minimal-gtk/main.c similarity index 100% rename from minimal-examples/gtk/minimal-gtk/main.c rename to minimal-examples-lowlevel/gtk/minimal-gtk/main.c diff --git a/minimal-examples/gtk/minimal-gtk/warmcat.com.cer b/minimal-examples-lowlevel/gtk/minimal-gtk/warmcat.com.cer similarity index 100% rename from minimal-examples/gtk/minimal-gtk/warmcat.com.cer rename to minimal-examples-lowlevel/gtk/minimal-gtk/warmcat.com.cer diff --git a/minimal-examples/http-client/README.md b/minimal-examples-lowlevel/http-client/README.md similarity index 100% rename from minimal-examples/http-client/README.md rename to minimal-examples-lowlevel/http-client/README.md diff --git a/minimal-examples/http-client/minimal-http-client-attach/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-attach/CMakeLists.txt similarity index 100% rename from minimal-examples/http-client/minimal-http-client-attach/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-attach/CMakeLists.txt diff --git a/minimal-examples/http-client/minimal-http-client-attach/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-attach/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-attach/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-attach/README.md diff --git a/minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c b/minimal-examples-lowlevel/http-client/minimal-http-client-attach/minimal-http-client-attach.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-attach/minimal-http-client-attach.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-attach/minimal-http-client-attach.c diff --git a/minimal-examples/http-client/minimal-http-client-captive-portal/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/CMakeLists.txt similarity index 100% rename from minimal-examples/http-client/minimal-http-client-captive-portal/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/CMakeLists.txt diff --git a/minimal-examples/http-client/minimal-http-client-captive-portal/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-captive-portal/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/README.md diff --git a/minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c b/minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-captive-portal/minimal-http-client-captive-portal.c diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/CMakeLists.txt similarity index 100% rename from minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/CMakeLists.txt diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-certinfo/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/README.md diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c b/minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-certinfo/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-certinfo/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-custom-headers/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/CMakeLists.txt similarity index 100% rename from minimal-examples/http-client/minimal-http-client-custom-headers/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/CMakeLists.txt diff --git a/minimal-examples/http-client/minimal-http-client-custom-headers/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-custom-headers/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/README.md diff --git a/minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c b/minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/minimal-http-client-custom-headers.c diff --git a/minimal-examples/http-client/minimal-http-client-custom-headers/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-custom-headers/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-custom-headers/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt similarity index 91% rename from minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt index 9a2dc65db..d3004facc 100644 --- a/minimal-examples/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/CMakeLists.txt @@ -22,7 +22,7 @@ if (requirements) set_tests_properties(http-client-h2-rxflow-warmcat http-client-h2-rxflow-warmcat-h1 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-h2-rxflow + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow TIMEOUT 30) endif() diff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-h2-rxflow/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/README.md diff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c b/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/minimal-http-client.c diff --git a/minimal-examples/http-client/minimal-http-client-h2-rxflow/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-h2-rxflow/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-h2-rxflow/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/CMakeLists.txt similarity index 92% rename from minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/CMakeLists.txt index cb42d1fba..25b82369f 100644 --- a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/CMakeLists.txt @@ -29,7 +29,7 @@ if (requirements) set_tests_properties(http-client-hugeurl-warmcat http-client-hugeurl-warmcat-h1 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-hugeurl + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl TIMEOUT 20) if (DEFINED ENV{SAI_OVN}) set_tests_properties(http-client-hugeurl-warmcat diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-hugeurl/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/README.md diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c b/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-hugeurl/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-hugeurl/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/CMakeLists.txt similarity index 98% rename from minimal-examples/http-client/minimal-http-client-jit-trust/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/CMakeLists.txt index eef5cd8d7..fb968d522 100644 --- a/minimal-examples/http-client/minimal-http-client-jit-trust/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/CMakeLists.txt @@ -138,7 +138,7 @@ if (requirements) endif() set_tests_properties(${mytests} PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client TIMEOUT 20) if (DEFINED ENV{SAI_OVN}) diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-jit-trust/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/README.md diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/minimal-http-client.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-jit-trust/minimal-http-client.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/minimal-http-client.c diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/trust_blob.h b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/trust_blob.h similarity index 100% rename from minimal-examples/http-client/minimal-http-client-jit-trust/trust_blob.h rename to minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/trust_blob.h diff --git a/minimal-examples/http-client/minimal-http-client-jit-trust/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-jit-trust/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-multi/CMakeLists.txt similarity index 96% rename from minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-multi/CMakeLists.txt index 22d138cc2..81789cc19 100644 --- a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client-multi/CMakeLists.txt @@ -98,7 +98,7 @@ else() endif() set_tests_properties(st_hcm_srv PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-tls + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-tls FIXTURES_SETUP hcm_srv TIMEOUT 800) set_tests_properties(ki_hcm_srv PROPERTIES @@ -159,7 +159,7 @@ endif() http-client-multi-stag-h1-pipe PROPERTIES FIXTURES_REQUIRED "hcm_srv" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-multi + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-multi TIMEOUT 50) # POSTs against local http-server-form-post @@ -194,7 +194,7 @@ endif() http-client-multi-post-stag-h1-pipe PROPERTIES FIXTURES_REQUIRED "hcmp_srv" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-multi + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-multi TIMEOUT 20) endif(NOT WIN32 AND LWS_WITH_SERVER) diff --git a/minimal-examples/http-client/minimal-http-client-multi/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-multi/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-multi/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-multi/README.md diff --git a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c b/minimal-examples-lowlevel/http-client/minimal-http-client-multi/minimal-http-client-multi.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-multi/minimal-http-client-multi.c diff --git a/minimal-examples/http-client/minimal-http-client-multi/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-multi/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-multi/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-multi/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client-post/CMakeLists.txt similarity index 96% rename from minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client-post/CMakeLists.txt index b4e4b74c2..e2aa5ed9f 100644 --- a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client-post/CMakeLists.txt @@ -95,7 +95,7 @@ endif() http-client-post-m-h1 PROPERTIES FIXTURES_REQUIRED "hcp_srv" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-post + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client-post TIMEOUT 20) endif() diff --git a/minimal-examples/http-client/minimal-http-client-post/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client-post/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client-post/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client-post/README.md diff --git a/minimal-examples/http-client/minimal-http-client-post/libwebsockets.org.cer b/minimal-examples-lowlevel/http-client/minimal-http-client-post/libwebsockets.org.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client-post/libwebsockets.org.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client-post/libwebsockets.org.cer diff --git a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c b/minimal-examples-lowlevel/http-client/minimal-http-client-post/minimal-http-client-post.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c rename to minimal-examples-lowlevel/http-client/minimal-http-client-post/minimal-http-client-post.c diff --git a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt b/minimal-examples-lowlevel/http-client/minimal-http-client/CMakeLists.txt similarity index 96% rename from minimal-examples/http-client/minimal-http-client/CMakeLists.txt rename to minimal-examples-lowlevel/http-client/minimal-http-client/CMakeLists.txt index 8c42ae9f7..73c0cdbf0 100644 --- a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-client/minimal-http-client/CMakeLists.txt @@ -37,6 +37,8 @@ require_lws_config(LWS_WITH_SYS_DHCP_CLIENT 0 has_no_system_vhost) require_lws_config(LWS_WITH_SYS_ASYNC_DNS 1 has_async_dns) require_lws_config(LWS_WITH_MBEDTLS 1 has_mbedtls) +message("FI ${has_fault_injection}") + if (requirements) add_executable(${SAMP} ${SRCS}) @@ -55,6 +57,8 @@ if (requirements) add_test(NAME http-client-warmcat-h1 COMMAND lws-minimal-http-client --h1) if (has_fault_injection) + + message("... has LWS_WITH_SYS_FAULT_INJECTION") # creation related faults @@ -134,7 +138,8 @@ if (requirements) list(APPEND mytests http-client-fi-user-est-fail) add_test(NAME http-client-fi-user-est-fail COMMAND lws-minimal-http-client --expected-exit 3 --fault-injection "wsi/user_reject_at_est") - + else() + message("... NO LWS_WITH_SYS_FAULT_INJECTION") endif() if (has_mbedtls) list(APPEND mytests http-client-mbedtls-wrong-ca) @@ -145,7 +150,7 @@ if (requirements) endif() set_tests_properties(${mytests} PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-client/minimal-http-client TIMEOUT 20) if (DEFINED ENV{SAI_OVN}) diff --git a/minimal-examples/http-client/minimal-http-client/README.md b/minimal-examples-lowlevel/http-client/minimal-http-client/README.md similarity index 100% rename from minimal-examples/http-client/minimal-http-client/README.md rename to minimal-examples-lowlevel/http-client/minimal-http-client/README.md diff --git a/minimal-examples/http-client/minimal-http-client/minimal-http-client.c b/minimal-examples-lowlevel/http-client/minimal-http-client/minimal-http-client.c similarity index 100% rename from minimal-examples/http-client/minimal-http-client/minimal-http-client.c rename to minimal-examples-lowlevel/http-client/minimal-http-client/minimal-http-client.c diff --git a/minimal-examples/http-client/minimal-http-client/warmcat.com.cer b/minimal-examples-lowlevel/http-client/minimal-http-client/warmcat.com.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client/warmcat.com.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client/warmcat.com.cer diff --git a/minimal-examples/http-client/minimal-http-client/wrong.cer b/minimal-examples-lowlevel/http-client/minimal-http-client/wrong.cer similarity index 100% rename from minimal-examples/http-client/minimal-http-client/wrong.cer rename to minimal-examples-lowlevel/http-client/minimal-http-client/wrong.cer diff --git a/minimal-examples/http-server/README.md b/minimal-examples-lowlevel/http-server/README.md similarity index 100% rename from minimal-examples/http-server/README.md rename to minimal-examples-lowlevel/http-server/README.md diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/README.md diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/ba-passwords b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/ba-passwords similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/ba-passwords rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/ba-passwords diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/minimal-http-server-basicauth.c diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-secret-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-secret-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-secret-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-secret-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-basicauth/mount-secret-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-secret-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-basicauth/mount-secret-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-basicauth/mount-secret-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-cgi/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-cgi/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-cgi/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-cgi/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-cgi/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-cgi/README.md diff --git a/minimal-examples/http-server/minimal-http-server-cgi/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-cgi/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-cgi/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server-cgi/my-cgi-script.sh b/minimal-examples-lowlevel/http-server/minimal-http-server-cgi/my-cgi-script.sh similarity index 100% rename from minimal-examples/http-server/minimal-http-server-cgi/my-cgi-script.sh rename to minimal-examples-lowlevel/http-server/minimal-http-server-cgi/my-cgi-script.sh diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/README.md diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/minimal-http-server-custom-headers.c diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/error.css b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/error.css similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/error.css rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/error.css diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-custom-headers/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-custom-headers/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/README.md diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/ba-passwords b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/ba-passwords similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/ba-passwords rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/ba-passwords diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/minimal-http-server-deaddrop.c diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.css b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.css similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.css rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.css diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/deaddrop.js diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/drop.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/drop.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/drop.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/drop.svg diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-deaddrop/uploads/user1/placeholder.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/uploads/user1/placeholder.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-deaddrop/uploads/user1/placeholder.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-deaddrop/uploads/user1/placeholder.txt diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/README.md diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/minimal-http-server-dynamic.c diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-dynamic/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-dynamic/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/README.md diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/symlink.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/symlink.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-custom/mount-origin/symlink.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-custom/mount-origin/symlink.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/README.md diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/minimal-http-server-eventlib-demos.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/candide-uncompressed.zip b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/candide-uncompressed.zip similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/candide-uncompressed.zip rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/candide-uncompressed.zip diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/candide.zip b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/candide.zip similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/candide.zip rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/candide.zip diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/http2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/http2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/http2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/http2.png diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/leaf.jpg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/leaf.jpg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/leaf.jpg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/leaf.jpg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/lws-common.js diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.css b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.css similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.css rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.css diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.js b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/test.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/test.js diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/wss-over-h2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/wss-over-h2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-demos/mount-origin/wss-over-h2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-demos/mount-origin/wss-over-h2.png diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt similarity index 90% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt index fc22523ed..b1b65bf09 100644 --- a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt +++ b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/CMakeLists.txt @@ -138,7 +138,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_uv PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() if (LWS_WITH_LIBEVENT) @@ -146,7 +146,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_event PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() if (LWS_WITH_LIBEV) @@ -154,7 +154,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_ev PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() if (LWS_WITH_GLIB) @@ -162,7 +162,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_glib PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() if (LWS_WITH_SDEVENT) @@ -170,7 +170,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_sd PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() if (LWS_WITH_SDEVENT) @@ -178,7 +178,7 @@ if (requirements) set_tests_properties(hs_evlib_foreign_uloop PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/lib" - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-server/minimal-http-server-eventlib-foreign + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign TIMEOUT 50) endif() diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/README.md diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/glib.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/glib.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/glib.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/glib.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/libev.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libev.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/libev.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libev.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/libevent.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libevent.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/libevent.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libevent.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/libsdevent.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libsdevent.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/libsdevent.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libsdevent.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/libuv.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libuv.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/libuv.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/libuv.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/minimal-http-server-eventlib-foreign.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/private.h b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/private.h similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/private.h rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/private.h diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-foreign/uloop.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/uloop.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-foreign/uloop.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-foreign/uloop.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/README.md diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/minimal-http-server-eventlib-smp.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib-smp/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib-smp/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/README.md diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/minimal-http-server-eventlib.c diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-eventlib/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-eventlib/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-form-get/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/README.md diff --git a/minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/minimal-http-server-form-get.c diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/after-form1.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/after-form1.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/after-form1.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/after-form1.html diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-get/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-get/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-get/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/README.md diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/minimal-http-server-form-post-file.c diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/after-form1.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/after-form1.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/after-form1.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/after-form1.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-file/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-file/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-lwsac/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-lwsac/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/README.md diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-lwsac/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-lwsac/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post-lwsac/minimal-http-server-form-post.c diff --git a/minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-form-post/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/README.md diff --git a/minimal-examples/http-server/minimal-http-server-form-post/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-form-post/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/minimal-http-server-form-post.c diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/after-form1.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/after-form1.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/after-form1.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/after-form1.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-form-post/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-form-post/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-form-post/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/README.md diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/lws-fts.index b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/lws-fts.index similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/lws-fts.index rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/lws-fts.index diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/dorian-gray-wikipedia.jpg b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/dorian-gray-wikipedia.jpg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/dorian-gray-wikipedia.jpg rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/dorian-gray-wikipedia.jpg diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.css b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.css similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.css rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.css diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.js b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/lws-fts.js diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-fulltext-search/the-picture-of-dorian-gray.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/the-picture-of-dorian-gray.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-fulltext-search/the-picture-of-dorian-gray.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-fulltext-search/the-picture-of-dorian-gray.txt diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-h2-long-poll/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-h2-long-poll/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/README.md diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-h2-long-poll/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-h2-long-poll/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-h2-long-poll/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/README.md diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/minimal-http-server-mimetypes.c diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/test.tar.bz2 b/minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/test.tar.bz2 similarity index 100% rename from minimal-examples/http-server/minimal-http-server-mimetypes/mount-origin/test.tar.bz2 rename to minimal-examples-lowlevel/http-server/minimal-http-server-mimetypes/mount-origin/test.tar.bz2 diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/README.md diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/404.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/index.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost1/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost1/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/404.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/index.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost2/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost2/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/404.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/index.html diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-multivhost/mount-origin-localhost3/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-multivhost/mount-origin-localhost3/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-proxy/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-proxy/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-proxy/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/minimal-http-server-proxy.c diff --git a/minimal-examples/http-server/minimal-http-server-proxy/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-proxy/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-proxy/mount-origin/http2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/http2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/mount-origin/http2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/http2.png diff --git a/minimal-examples/http-server/minimal-http-server-proxy/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-proxy/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-proxy/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-smp/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/README.md diff --git a/minimal-examples/http-server/minimal-http-server-smp/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-smp/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-smp/minimal-http-server-smp.c b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/minimal-http-server-smp.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/minimal-http-server-smp.c diff --git a/minimal-examples/http-server/minimal-http-server-smp/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-smp/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-smp/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-smp/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-smp/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-smp/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/README.md diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/minimal-http-server-sse-ring.c diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/example.js b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/example.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/example.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/example.js diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse-ring/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse-ring/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-sse/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/README.md diff --git a/minimal-examples/http-server/minimal-http-server-sse/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-sse/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/minimal-http-server-sse.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/minimal-http-server-sse.c diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/example.js b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/example.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/example.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/example.js diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-sse/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-sse/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-sse/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/README.md diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/minimal-http-server-tls-80.c diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/example.js b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/example.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/example.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/example.js diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/http2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/http2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/http2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/http2.png diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-80/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-80/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/README.md diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/minimal-http-server-tls-mem.c diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/example.js b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/example.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/example.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/example.js diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/http2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/http2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/http2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/http2.png diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls-mem/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls-mem/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server-tls/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/README.md diff --git a/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.cert b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/localhost-100y.cert similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/localhost-100y.cert rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/localhost-100y.cert diff --git a/minimal-examples/http-server/minimal-http-server-tls/localhost-100y.key b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/localhost-100y.key similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/localhost-100y.key rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/localhost-100y.key diff --git a/minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/minimal-http-server-tls.c rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/minimal-http-server-tls.c diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/example.js b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/example.js similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/example.js rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/example.js diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/http2.png b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/http2.png similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/http2.png rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/http2.png diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server-tls/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server-tls/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server-tls/mount-origin/strict-csp.svg diff --git a/minimal-examples/http-server/minimal-http-server/CMakeLists.txt b/minimal-examples-lowlevel/http-server/minimal-http-server/CMakeLists.txt similarity index 100% rename from minimal-examples/http-server/minimal-http-server/CMakeLists.txt rename to minimal-examples-lowlevel/http-server/minimal-http-server/CMakeLists.txt diff --git a/minimal-examples/http-server/minimal-http-server/README.md b/minimal-examples-lowlevel/http-server/minimal-http-server/README.md similarity index 100% rename from minimal-examples/http-server/minimal-http-server/README.md rename to minimal-examples-lowlevel/http-server/minimal-http-server/README.md diff --git a/minimal-examples/http-server/minimal-http-server/minimal-http-server.c b/minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c similarity index 100% rename from minimal-examples/http-server/minimal-http-server/minimal-http-server.c rename to minimal-examples-lowlevel/http-server/minimal-http-server/minimal-http-server.c diff --git a/minimal-examples/http-server/minimal-http-server/mount-origin/404.html b/minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/404.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server/mount-origin/404.html rename to minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/404.html diff --git a/minimal-examples/http-server/minimal-http-server/mount-origin/favicon.ico b/minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/http-server/minimal-http-server/mount-origin/favicon.ico rename to minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/favicon.ico diff --git a/minimal-examples/http-server/minimal-http-server/mount-origin/index.html b/minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/index.html similarity index 100% rename from minimal-examples/http-server/minimal-http-server/mount-origin/index.html rename to minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/index.html diff --git a/minimal-examples/http-server/minimal-http-server/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/http-server/minimal-http-server/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/http-server/minimal-http-server/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/http-server/minimal-http-server/mount-origin/strict-csp.svg diff --git a/minimal-examples/mqtt-client/README.md b/minimal-examples-lowlevel/mqtt-client/README.md similarity index 100% rename from minimal-examples/mqtt-client/README.md rename to minimal-examples-lowlevel/mqtt-client/README.md diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/CMakeLists.txt b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/CMakeLists.txt similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/CMakeLists.txt rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/CMakeLists.txt diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/README.md b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/README.md similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/README.md rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/README.md diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/minimal-mqtt-client-multi.c diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/selftest.sh.broken-on-travis b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/selftest.sh.broken-on-travis similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/selftest.sh.broken-on-travis rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/selftest.sh.broken-on-travis diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/warmcat.com.cer b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/warmcat.com.cer similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/warmcat.com.cer rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/warmcat.com.cer diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client-multi/wget-log b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/wget-log similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client-multi/wget-log rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client-multi/wget-log diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/CMakeLists.txt b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/CMakeLists.txt similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/CMakeLists.txt rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/CMakeLists.txt diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/README.md b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/README.md similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/README.md rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/README.md diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/minimal-mqtt-client.c diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/mosq-ca.crt b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-ca.crt similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/mosq-ca.crt rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-ca.crt diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/mosq-server.crt b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-server.crt similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/mosq-server.crt rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-server.crt diff --git a/minimal-examples/mqtt-client/minimal-mqtt-client/mosq-server.key b/minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-server.key similarity index 100% rename from minimal-examples/mqtt-client/minimal-mqtt-client/mosq-server.key rename to minimal-examples-lowlevel/mqtt-client/minimal-mqtt-client/mosq-server.key diff --git a/minimal-examples/raw/README.md b/minimal-examples-lowlevel/raw/README.md similarity index 100% rename from minimal-examples/raw/README.md rename to minimal-examples-lowlevel/raw/README.md diff --git a/minimal-examples/raw/minimal-raw-adopt-tcp/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-tcp/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-adopt-tcp/README.md b/minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-tcp/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/README.md diff --git a/minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c b/minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-tcp/minimal-raw-adopt-tcp.c diff --git a/minimal-examples/raw/minimal-raw-adopt-udp/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-udp/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-adopt-udp/README.md b/minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-udp/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/README.md diff --git a/minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c b/minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c similarity index 100% rename from minimal-examples/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c rename to minimal-examples-lowlevel/raw/minimal-raw-adopt-udp/minimal-raw-adopt-udp.c diff --git a/minimal-examples/raw/minimal-raw-audio/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-audio/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-audio/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-audio/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-audio/README.md b/minimal-examples-lowlevel/raw/minimal-raw-audio/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-audio/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-audio/README.md diff --git a/minimal-examples/raw/minimal-raw-audio/audio.c b/minimal-examples-lowlevel/raw/minimal-raw-audio/audio.c similarity index 100% rename from minimal-examples/raw/minimal-raw-audio/audio.c rename to minimal-examples-lowlevel/raw/minimal-raw-audio/audio.c diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/README.md b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/README.md diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/localhost-100y.cert b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/localhost-100y.cert similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/localhost-100y.cert rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/localhost-100y.cert diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/localhost-100y.key b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/localhost-100y.key similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/localhost-100y.key rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/localhost-100y.key diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/minimal-raw-fallback-http-server.c diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/404.html b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/404.html similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/404.html rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/404.html diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/favicon.ico b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/favicon.ico rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/favicon.ico diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/index.html b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/index.html similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/index.html rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/index.html diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/raw/minimal-raw-fallback-http-server/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/raw/minimal-raw-fallback-http-server/mount-origin/strict-csp.svg diff --git a/minimal-examples/raw/minimal-raw-file/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-file/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-file/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-file/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-file/README.md b/minimal-examples-lowlevel/raw/minimal-raw-file/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-file/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-file/README.md diff --git a/minimal-examples/raw/minimal-raw-file/minimal-raw-file.c b/minimal-examples-lowlevel/raw/minimal-raw-file/minimal-raw-file.c similarity index 100% rename from minimal-examples/raw/minimal-raw-file/minimal-raw-file.c rename to minimal-examples-lowlevel/raw/minimal-raw-file/minimal-raw-file.c diff --git a/minimal-examples/raw/minimal-raw-netcat/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-netcat/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-netcat/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-netcat/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-netcat/README.md b/minimal-examples-lowlevel/raw/minimal-raw-netcat/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-netcat/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-netcat/README.md diff --git a/minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c b/minimal-examples-lowlevel/raw/minimal-raw-netcat/minimal-raw-netcat.c similarity index 100% rename from minimal-examples/raw/minimal-raw-netcat/minimal-raw-netcat.c rename to minimal-examples-lowlevel/raw/minimal-raw-netcat/minimal-raw-netcat.c diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/README.md b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/README.md diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/localhost-100y.cert b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/localhost-100y.cert similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/localhost-100y.cert rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/localhost-100y.cert diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/localhost-100y.key b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/localhost-100y.key similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/localhost-100y.key rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/localhost-100y.key diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/minimal-raw-proxy-fallback.c diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/404.html b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/404.html similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/404.html rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/404.html diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/favicon.ico b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/favicon.ico rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/favicon.ico diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/index.html b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/index.html similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/index.html rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/index.html diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy-fallback/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/raw/minimal-raw-proxy-fallback/mount-origin/strict-csp.svg diff --git a/minimal-examples/raw/minimal-raw-proxy/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-proxy/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-proxy/README.md b/minimal-examples-lowlevel/raw/minimal-raw-proxy/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-proxy/README.md diff --git a/minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c b/minimal-examples-lowlevel/raw/minimal-raw-proxy/minimal-raw-proxy.c similarity index 100% rename from minimal-examples/raw/minimal-raw-proxy/minimal-raw-proxy.c rename to minimal-examples-lowlevel/raw/minimal-raw-proxy/minimal-raw-proxy.c diff --git a/minimal-examples/raw/minimal-raw-serial/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-serial/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-serial/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-serial/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-serial/README.md b/minimal-examples-lowlevel/raw/minimal-raw-serial/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-serial/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-serial/README.md diff --git a/minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c b/minimal-examples-lowlevel/raw/minimal-raw-serial/minimal-raw-file.c similarity index 100% rename from minimal-examples/raw/minimal-raw-serial/minimal-raw-file.c rename to minimal-examples-lowlevel/raw/minimal-raw-serial/minimal-raw-file.c diff --git a/minimal-examples/raw/minimal-raw-vhost/CMakeLists.txt b/minimal-examples-lowlevel/raw/minimal-raw-vhost/CMakeLists.txt similarity index 100% rename from minimal-examples/raw/minimal-raw-vhost/CMakeLists.txt rename to minimal-examples-lowlevel/raw/minimal-raw-vhost/CMakeLists.txt diff --git a/minimal-examples/raw/minimal-raw-vhost/README.md b/minimal-examples-lowlevel/raw/minimal-raw-vhost/README.md similarity index 100% rename from minimal-examples/raw/minimal-raw-vhost/README.md rename to minimal-examples-lowlevel/raw/minimal-raw-vhost/README.md diff --git a/minimal-examples/raw/minimal-raw-vhost/localhost-100y.cert b/minimal-examples-lowlevel/raw/minimal-raw-vhost/localhost-100y.cert similarity index 100% rename from minimal-examples/raw/minimal-raw-vhost/localhost-100y.cert rename to minimal-examples-lowlevel/raw/minimal-raw-vhost/localhost-100y.cert diff --git a/minimal-examples/raw/minimal-raw-vhost/localhost-100y.key b/minimal-examples-lowlevel/raw/minimal-raw-vhost/localhost-100y.key similarity index 100% rename from minimal-examples/raw/minimal-raw-vhost/localhost-100y.key rename to minimal-examples-lowlevel/raw/minimal-raw-vhost/localhost-100y.key diff --git a/minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c b/minimal-examples-lowlevel/raw/minimal-raw-vhost/minimal-raw-vhost.c similarity index 100% rename from minimal-examples/raw/minimal-raw-vhost/minimal-raw-vhost.c rename to minimal-examples-lowlevel/raw/minimal-raw-vhost/minimal-raw-vhost.c diff --git a/minimal-examples/secure-streams/README.md b/minimal-examples-lowlevel/secure-streams/README.md similarity index 100% rename from minimal-examples/secure-streams/README.md rename to minimal-examples-lowlevel/secure-streams/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/alexa.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/alexa.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/alexa.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/alexa.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/alexa_linux.ppn b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/alexa_linux.ppn similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/alexa_linux.ppn rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/alexa_linux.ppn diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/audio.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/audio.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/audio.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/audio.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/porcupine_params.pv b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/porcupine_params.pv similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/porcupine_params.pv rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/porcupine_params.pv diff --git a/minimal-examples/secure-streams/minimal-secure-streams-alexa/private.h b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/private.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-alexa/private.h rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-alexa/private.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-avs/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-avs/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-avs/avs.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/avs.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-avs/avs.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/avs.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-avs/main-client.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/main-client.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-avs/main-client.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/main-client.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-avs/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-avs/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-avs/year.wav b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/year.wav similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-avs/year.wav rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-avs/year.wav diff --git a/minimal-examples/secure-streams/minimal-secure-streams-binance/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-binance/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-binance/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-binance/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-binance/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-binance/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-binance/policy.json b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/policy.json similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-binance/policy.json rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-binance/policy.json diff --git a/minimal-examples/secure-streams/minimal-secure-streams-blob/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/CMakeLists.txt similarity index 95% rename from minimal-examples/secure-streams/minimal-secure-streams-blob/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/CMakeLists.txt index ceb2d15fa..27d0b533d 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-blob/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/CMakeLists.txt @@ -51,7 +51,7 @@ if (requirements) set_tests_properties(ssblob-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams TIMEOUT 40) if (DEFINED ENV{SAI_OVN}) set_tests_properties(ssblob-warmcat PROPERTIES FIXTURES_REQUIRED "res_sspcmin") @@ -102,7 +102,7 @@ if (requirements) endif() set_tests_properties(sspcblob-minimal PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-blob + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob FIXTURES_REQUIRED "${fixlist}" TIMEOUT 70) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-blob/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-blob/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-blob/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-blob/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-blob/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt similarity index 95% rename from minimal-examples/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt index 1a943b939..b57e6fe71 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/CMakeLists.txt @@ -60,7 +60,7 @@ if (requirements) add_test(NAME sspc-minimaltx COMMAND lws-minimal-secure-streams-client-tx -i +${CTEST_SOCKET_PATH}) endif() set_tests_properties(sspc-minimaltx PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-client-tx + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx FIXTURES_REQUIRED "ssproxyctx" TIMEOUT 40) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-client-tx/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-client-tx/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-client-tx/minimal-secure-streams-client-tx.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/minimal-secure-streams-client-tx.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-client-tx/minimal-secure-streams-client-tx.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-client-tx/minimal-secure-streams-client-tx.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt similarity index 93% rename from minimal-examples/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt index 1f26c572c..f86e75d9f 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp/CMakeLists.txt @@ -22,7 +22,7 @@ if (requirements) add_test(NAME sscpp-warmcat COMMAND lws-minimal-secure-streams-cpp) set_tests_properties(sscpp-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-cpp + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp TIMEOUT 20) endif() diff --git a/minimal-examples/secure-streams/minimal-secure-streams-cpp/main.cxx b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp/main.cxx similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-cpp/main.cxx rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-cpp/main.cxx diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/app-event-loop.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/app-event-loop.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/app-event-loop.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/app-event-loop.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/binance-ss.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/binance-ss.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/binance-ss.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/binance-ss.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/policy.json b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/policy.json similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/policy.json rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/policy.json diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/private.h b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/private.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/private.h rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/private.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/system.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/system.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/system.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/system.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/transport-serial.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/transport-serial.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-client-transport/transport-serial.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-custom-client-transport/transport-serial.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt similarity index 95% rename from minimal-examples/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt index e0ac200c5..ff6cc6a72 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/CMakeLists.txt @@ -50,7 +50,7 @@ if (requirements) set_tests_properties(ss-warmcat-hurl PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams TIMEOUT 20) if (DEFINED ENV{SAI_OVN}) set_tests_properties(ss-warmcat-hurl PROPERTIES FIXTURES_REQUIRED "res_sspcmin_hurl") @@ -101,7 +101,7 @@ if (requirements) endif() set_tests_properties(sspc-minimal-hurl PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams FIXTURES_REQUIRED "${fixlist}" TIMEOUT 40) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-hugeurl/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-hugeurl/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-hugeurl/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-hugeurl/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-hugeurl/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-metadata/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-metadata/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-metadata/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-metadata/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-metadata/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-metadata/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metadata/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-metrics-proxy/metrics-proxy-policy.json b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metrics-proxy/metrics-proxy-policy.json similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-metrics-proxy/metrics-proxy-policy.json rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-metrics-proxy/metrics-proxy-policy.json diff --git a/minimal-examples/secure-streams/minimal-secure-streams-perf/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/CMakeLists.txt similarity index 95% rename from minimal-examples/secure-streams/minimal-secure-streams-perf/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/CMakeLists.txt index c0beb2686..3cb8cb0df 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-perf/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/CMakeLists.txt @@ -50,7 +50,7 @@ if (requirements) set_tests_properties(ssperf-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams TIMEOUT 40) if (DEFINED ENV{SAI_OVN}) set_tests_properties(ssperf-warmcat PROPERTIES FIXTURES_REQUIRED "res_ssperfpcmin") @@ -101,7 +101,7 @@ if (requirements) endif() set_tests_properties(ssperfpc-minimal PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-perf + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf FIXTURES_REQUIRED "${fixlist}" TIMEOUT 40) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-perf/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-perf/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-perf/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-policy2c/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-policy2c/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-policy2c/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-policy2c/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-policy2c/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-policy2c/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-policy2c/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-post/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/CMakeLists.txt similarity index 94% rename from minimal-examples/secure-streams/minimal-secure-streams-post/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/CMakeLists.txt index 62404153f..e8c94393e 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-post/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/CMakeLists.txt @@ -33,7 +33,7 @@ if (requirements) endif() set_tests_properties(sspost-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-post + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post TIMEOUT 20) endif() diff --git a/minimal-examples/secure-streams/minimal-secure-streams-post/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-post/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-post/minimal-secure-streams-post.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/minimal-secure-streams-post.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-post/minimal-secure-streams-post.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-post/minimal-secure-streams-post.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-proxy/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-proxy/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-proxy/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-proxy/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-seq/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-seq/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-seq/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-seq/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-seq/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-seq/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-seq/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server-raw/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server-raw/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server-raw/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server-raw/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server-raw/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server-raw/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server-raw/ss-server.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/ss-server.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server-raw/ss-server.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server-raw/ss-server.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server/main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server/main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server/ss-client.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/ss-client.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server/ss-client.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/ss-client.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-server/ss-server.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/ss-server.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-server/ss-server.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-server/ss-server.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt similarity index 93% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt index 47deb88f4..7a76fe869 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/CMakeLists.txt @@ -30,7 +30,7 @@ if (requirements) set_tests_properties(ss-sigv4 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-sigv4 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4 TIMEOUT 20) if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR LWS_WITH_SECURE_STREAMS_PROXY_API) @@ -72,7 +72,7 @@ if (requirements) add_test(NAME sspc-sigv4 COMMAND lws-minimal-secure-streams-sigv4-client -i +${CTEST_SOCKET_PATH}) endif() set_tests_properties(sspc-sigv4 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-sigv4 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4 FIXTURES_REQUIRED "ssproxysigv4" TIMEOUT 40) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/policy.json b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/policy.json similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/policy.json rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/policy.json diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-main.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-main.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-main.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-main.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-put.h b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-put.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-put.h rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-put.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-ss.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-ss.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/ss-s3-ss.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/ss-s3-ss.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-sigv4/static_policy.h b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/static_policy.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-sigv4/static_policy.h rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-sigv4/static_policy.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-smd/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/CMakeLists.txt similarity index 94% rename from minimal-examples/secure-streams/minimal-secure-streams-smd/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/CMakeLists.txt index db2f9ebc9..d5488deb9 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-smd/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/CMakeLists.txt @@ -32,7 +32,7 @@ if (requirements) endif() set_tests_properties(ss-smd PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-smd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd TIMEOUT 10) if (has_fault_injection) @@ -68,7 +68,7 @@ if (requirements) ss-smd-fi2 ss-smd-fi3 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-smd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd TIMEOUT 5) endif() @@ -135,7 +135,7 @@ if (requirements) add_test(NAME sspcsmd_sspc COMMAND lws-minimal-secure-streams-smd-client -i +${CTEST_SOCKET_PATH}) endif() set_tests_properties(sspcsmd_sspc PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-smd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd FIXTURES_REQUIRED "ssproxysmd_sspc" TIMEOUT 80) @@ -178,7 +178,7 @@ if (requirements) add_test(NAME mulsspcsmd_sspc COMMAND lws-minimal-secure-streams-smd-client -i +${CTEST_SOCKET_PATH} --multi -d1039) endif() set_tests_properties(mulsspcsmd_sspc PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-smd + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd FIXTURES_REQUIRED "mulssproxysmd_sspc" TIMEOUT 80) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-smd/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-smd/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-smd/minimal-secure-streams-smd.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/minimal-secure-streams-smd.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-smd/minimal-secure-streams-smd.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/minimal-secure-streams-smd.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-smd/multi.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/multi.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-smd/multi.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-smd/multi.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/CMakeLists.txt similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/CMakeLists.txt diff --git a/minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/static-policy.h b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/static-policy.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/static-policy.h rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/static-policy.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/static-policy.json b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/static-policy.json similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-staticpolicy/static-policy.json rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-staticpolicy/static-policy.json diff --git a/minimal-examples/secure-streams/minimal-secure-streams-stress/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/CMakeLists.txt similarity index 82% rename from minimal-examples/secure-streams/minimal-secure-streams-stress/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/CMakeLists.txt index 769eacef7..17e76e38c 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-stress/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/CMakeLists.txt @@ -31,10 +31,10 @@ if (requirements) # the time given in seconds or the sai-resource instance # exits, whichever happens first # - # If running under Sai, creates a lock test called "res_sspcmin" + # If running under Sai, creates a lock test called "res_sspcmin-stress" # - sai_resource(warmcat_conns 1 40 sspcmin) + sai_resource(warmcat_conns 1 40 sspcmin-stress) # # simple test not via proxy @@ -44,14 +44,14 @@ if (requirements) message("testing via valgrind") add_test(NAME ssstress-warmcat COMMAND ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 - $ -c 4 --budget 5) + $ -c 4 --budget 5 --timeout_ms 60000) else() - add_test(NAME ssstress-warmcat COMMAND lws-minimal-secure-streams-stress -c 4 --budget 5) + add_test(NAME ssstress-warmcat COMMAND lws-minimal-secure-streams-stress -c 4 --budget 5 --timeout_ms 50000) endif() set_tests_properties(ssstress-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-stress + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress TIMEOUT 80) if (DEFINED ENV{SAI_OVN}) set_tests_properties(ssstress-warmcat PROPERTIES FIXTURES_REQUIRED "res_sspcmin") @@ -88,24 +88,24 @@ if (requirements) # the client part that will connect to the proxy # - if (VALGRIND) - message("testing via valgrind") - add_test(NAME sspc-minimalstress COMMAND - ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 - $ -i +${CTEST_SOCKET_PATH} -c 2 --budget 3) - else() - add_test(NAME sspc-minimalstress COMMAND lws-minimal-secure-streams-stress-client -i +${CTEST_SOCKET_PATH} -c 2 --budget 3) - endif() + # if (VALGRIND) + # message("testing via valgrind") + # add_test(NAME sspc-minimalstress COMMAND + # ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + # $ -i +${CTEST_SOCKET_PATH} -c 2 --budget 3 --timeout_ms 60000) + # else() + add_test(NAME sspc-minimalstress COMMAND lws-minimal-secure-streams-stress-client -i +${CTEST_SOCKET_PATH} -c 2 --budget 3 --timeout_ms 50000) + # endif() set(fixlist "ssstressproxy") if (DEFINED ENV{SAI_OVN}) - list(APPEND fixlist "res_ssproxy") + list(APPEND fixlist "res_sspcmin-stress") endif() set_tests_properties(sspc-minimalstress PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-stress + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress FIXTURES_REQUIRED "${fixlist}" - TIMEOUT 80) + TIMEOUT 100) endif() diff --git a/minimal-examples/secure-streams/minimal-secure-streams-stress/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-stress/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-stress/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-stress/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-stress/minimal-secure-streams.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt similarity index 93% rename from minimal-examples/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt index cd194e18d..ae2f2c827 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/CMakeLists.txt @@ -30,7 +30,7 @@ if (requirements) set_tests_properties(ss-tf PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-testsfail + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail TIMEOUT 440) if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR LWS_WITH_SECURE_STREAMS_PROXY_API) @@ -72,7 +72,7 @@ if (requirements) endif() set_tests_properties(sspc-minimaltf PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-testsfail + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail FIXTURES_REQUIRED "sstfproxy" TIMEOUT 440) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-testsfail/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-testsfail/minimal-secure-streams-testsfail.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams-threads/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/CMakeLists.txt similarity index 95% rename from minimal-examples/secure-streams/minimal-secure-streams-threads/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/CMakeLists.txt index 5272d8f70..9443dc2f8 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-threads/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/CMakeLists.txt @@ -32,7 +32,7 @@ if (requirements AND NOT WIN32) endif() set_tests_properties(ss-threads PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-threads + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads TIMEOUT 10) endif() @@ -95,7 +95,7 @@ if (requirements AND NOT WIN32) add_test(NAME sspcthreads_sspc COMMAND lws-minimal-secure-streams-threads-client -i +${CTEST_SOCKET_PATH}) endif() set_tests_properties(sspcthreads_sspc PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams-threads + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads FIXTURES_REQUIRED "ssproxythreads_sspc" TIMEOUT 80) diff --git a/minimal-examples/secure-streams/minimal-secure-streams-threads/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-threads/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams-threads/minimal-secure-streams-threads.c diff --git a/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams/CMakeLists.txt similarity index 94% rename from minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams/CMakeLists.txt index 7f576ed26..bdf8ef62e 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams/CMakeLists.txt +++ b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams/CMakeLists.txt @@ -52,7 +52,7 @@ if (requirements) set_tests_properties(ss-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams TIMEOUT 40) if (DEFINED ENV{SAI_OVN}) set_tests_properties(ss-warmcat PROPERTIES FIXTURES_REQUIRED "res_sspcmin") @@ -82,7 +82,7 @@ if (requirements) set_tests_properties(ss-warmcat-fi1 ss-warmcat-fi2 PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams TIMEOUT 5) endif() @@ -133,7 +133,7 @@ if (requirements) endif() set_tests_properties(sspc-minimal PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/secure-streams/minimal-secure-streams + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/secure-streams/minimal-secure-streams FIXTURES_REQUIRED "${fixlist}" TIMEOUT 40) diff --git a/minimal-examples/secure-streams/minimal-secure-streams/README.md b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams/README.md rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams/README.md diff --git a/minimal-examples/secure-streams/minimal-secure-streams/minimal-secure-streams.c b/minimal-examples-lowlevel/secure-streams/minimal-secure-streams/minimal-secure-streams.c similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams/minimal-secure-streams.c rename to minimal-examples-lowlevel/secure-streams/minimal-secure-streams/minimal-secure-streams.c diff --git a/minimal-examples/ws-client/README.md b/minimal-examples-lowlevel/ws-client/README.md similarity index 100% rename from minimal-examples/ws-client/README.md rename to minimal-examples-lowlevel/ws-client/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-binance/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-binance/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-binance/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-binance/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-binance/main.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/main.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-binance/main.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-binance/main.c diff --git a/minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-echo/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-echo/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/minimal-ws-client-echo.c diff --git a/minimal-examples/ws-client/minimal-ws-client-echo/protocol_lws_minimal_client_echo.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/protocol_lws_minimal_client_echo.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-echo/protocol_lws_minimal_client_echo.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-echo/protocol_lws_minimal_client_echo.c diff --git a/minimal-examples/ws-client/minimal-ws-client-ping/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-ping/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-ping/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-ping/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-ping/libwebsockets.org.cer b/minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/libwebsockets.org.cer similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-ping/libwebsockets.org.cer rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/libwebsockets.org.cer diff --git a/minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-ping/minimal-ws-client-ping.c diff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-pmd-bulk/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/minimal-ws-client-pmd-bulk.c diff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/protocol_lws_minimal_pmd_bulk.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/protocol_lws_minimal_pmd_bulk.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-pmd-bulk/protocol_lws_minimal_pmd_bulk.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-pmd-bulk/protocol_lws_minimal_pmd_bulk.c diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/CMakeLists.txt similarity index 89% rename from minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/CMakeLists.txt index faad60e49..043f9252c 100644 --- a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt +++ b/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/CMakeLists.txt @@ -18,7 +18,7 @@ if (requirements) add_test(NAME ws-client-rx-warmcat COMMAND lws-minimal-ws-client-rx -t) set_tests_properties(ws-client-rx-warmcat PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/ws-client/minimal-ws-client-rx + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx TIMEOUT 20) endif() diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-rx/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/libwebsockets.org.cer b/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/libwebsockets.org.cer similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-rx/libwebsockets.org.cer rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/libwebsockets.org.cer diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/minimal-ws-client.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-rx/minimal-ws-client.c diff --git a/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/libwebsockets.org.cer b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/libwebsockets.org.cer similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/libwebsockets.org.cer rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/libwebsockets.org.cer diff --git a/minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam-tx-rx/minimal-ws-client.c diff --git a/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/CMakeLists.txt similarity index 96% rename from minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/CMakeLists.txt index 34164e148..fc0402bfa 100644 --- a/minimal-examples/ws-client/minimal-ws-client-spam/CMakeLists.txt +++ b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/CMakeLists.txt @@ -71,7 +71,7 @@ endif() add_test(NAME ws-client-spam COMMAND lws-minimal-ws-client-spam --server localhost --port ${PORT_WCS_SRV} -l 32 -c 3) set_tests_properties(ws-client-spam PROPERTIES - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/ws-client/minimal-ws-client-spam + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam FIXTURES_REQUIRED "wcs_srv" TIMEOUT 40) endif() diff --git a/minimal-examples/ws-client/minimal-ws-client-spam/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-spam/libwebsockets.org.cer b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/libwebsockets.org.cer similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam/libwebsockets.org.cer rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/libwebsockets.org.cer diff --git a/minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-spam/minimal-ws-client-spam.c diff --git a/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client-tx/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-tx/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/minimal-ws-client.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client-tx/minimal-ws-client.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client-tx/minimal-ws-client.c diff --git a/minimal-examples/ws-client/minimal-ws-client/CMakeLists.txt b/minimal-examples-lowlevel/ws-client/minimal-ws-client/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client/CMakeLists.txt rename to minimal-examples-lowlevel/ws-client/minimal-ws-client/CMakeLists.txt diff --git a/minimal-examples/ws-client/minimal-ws-client/README.md b/minimal-examples-lowlevel/ws-client/minimal-ws-client/README.md similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client/README.md rename to minimal-examples-lowlevel/ws-client/minimal-ws-client/README.md diff --git a/minimal-examples/ws-client/minimal-ws-client/libwebsockets.org.cer b/minimal-examples-lowlevel/ws-client/minimal-ws-client/libwebsockets.org.cer similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client/libwebsockets.org.cer rename to minimal-examples-lowlevel/ws-client/minimal-ws-client/libwebsockets.org.cer diff --git a/minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c b/minimal-examples-lowlevel/ws-client/minimal-ws-client/minimal-ws-client.c similarity index 100% rename from minimal-examples/ws-client/minimal-ws-client/minimal-ws-client.c rename to minimal-examples-lowlevel/ws-client/minimal-ws-client/minimal-ws-client.c diff --git a/minimal-examples/ws-server/README.md b/minimal-examples-lowlevel/ws-server/README.md similarity index 100% rename from minimal-examples/ws-server/README.md rename to minimal-examples-lowlevel/ws-server/README.md diff --git a/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-broker/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/README.md diff --git a/minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/minimal-ws-broker.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/minimal-ws-broker.c diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-broker/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-broker/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-broker/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-broker/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-broker/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/README.md diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/localhost-100y.cert b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/localhost-100y.cert similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/localhost-100y.cert rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/localhost-100y.cert diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/localhost-100y.key b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/localhost-100y.key similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/localhost-100y.key rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/localhost-100y.key diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/minimal-ws-raw-proxy.c diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-raw-proxy/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-raw-proxy/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-echo/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-echo/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/minimal-ws-server-echo.c diff --git a/minimal-examples/ws-server/minimal-ws-server-echo/protocol_lws_minimal_server_echo.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/protocol_lws_minimal_server_echo.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-echo/protocol_lws_minimal_server_echo.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-echo/protocol_lws_minimal_server_echo.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/minimal-ws-server-pmd-bulk.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/protocol_lws_minimal_pmd_bulk.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/protocol_lws_minimal_pmd_bulk.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-bulk/protocol_lws_minimal_pmd_bulk.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-bulk/protocol_lws_minimal_pmd_bulk.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/minimal-ws-server-pmd-corner.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-corner/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd-corner/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd-corner/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/minimal-ws-server-pmd.c diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-pmd/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-pmd/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/minimal-ws-server-ring.c diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-ring/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/minimal-ws-server-threadpool.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threadpool/protocol_lws_minimal_threadpool.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/protocol_lws_minimal_threadpool.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threadpool/protocol_lws_minimal_threadpool.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threadpool/protocol_lws_minimal_threadpool.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/minimal-ws-server.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-foreign-libuv-smp/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-foreign-libuv-smp/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/minimal-ws-server.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads-smp/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads-smp/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads-smp/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/minimal-ws-server.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/minimal-ws-server.c diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-threads/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-threads/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-threads/protocol_lws_minimal.c diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/localhost-100y.cert b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/localhost-100y.cert similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/localhost-100y.cert rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/localhost-100y.cert diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/localhost-100y.key b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/localhost-100y.key similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/localhost-100y.key rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/localhost-100y.key diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/minimal-ws-server.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/minimal-ws-server.c diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server-timer/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server-timer/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt b/minimal-examples-lowlevel/ws-server/minimal-ws-server/CMakeLists.txt similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/CMakeLists.txt diff --git a/minimal-examples/ws-server/minimal-ws-server/README.md b/minimal-examples-lowlevel/ws-server/minimal-ws-server/README.md similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/README.md rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/README.md diff --git a/minimal-examples/ws-server/minimal-ws-server/localhost-100y.cert b/minimal-examples-lowlevel/ws-server/minimal-ws-server/localhost-100y.cert similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/localhost-100y.cert rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/localhost-100y.cert diff --git a/minimal-examples/ws-server/minimal-ws-server/localhost-100y.key b/minimal-examples-lowlevel/ws-server/minimal-ws-server/localhost-100y.key similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/localhost-100y.key rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/localhost-100y.key diff --git a/minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/minimal-ws-server.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/minimal-ws-server.c diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js b/minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/example.js similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/mount-origin/example.js rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/example.js diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/favicon.ico b/minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/favicon.ico similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/mount-origin/favicon.ico rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/favicon.ico diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/index.html b/minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/index.html similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/mount-origin/index.html rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/index.html diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/libwebsockets.org-logo.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/libwebsockets.org-logo.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/mount-origin/libwebsockets.org-logo.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/libwebsockets.org-logo.svg diff --git a/minimal-examples/ws-server/minimal-ws-server/mount-origin/strict-csp.svg b/minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/strict-csp.svg similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/mount-origin/strict-csp.svg rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/mount-origin/strict-csp.svg diff --git a/minimal-examples/ws-server/minimal-ws-server/protocol_lws_minimal.c b/minimal-examples-lowlevel/ws-server/minimal-ws-server/protocol_lws_minimal.c similarity index 100% rename from minimal-examples/ws-server/minimal-ws-server/protocol_lws_minimal.c rename to minimal-examples-lowlevel/ws-server/minimal-ws-server/protocol_lws_minimal.c diff --git a/minimal-examples/CMakeLists.txt b/minimal-examples/CMakeLists.txt index 8591c2ef3..2fab2af06 100644 --- a/minimal-examples/CMakeLists.txt +++ b/minimal-examples/CMakeLists.txt @@ -1,7 +1,7 @@ # # libwebsockets - small server side websockets and web server implementation # -# Copyright (C) 2010 - 2020 Andy Green +# Copyright (C) 2010 - 2021 Andy Green # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to @@ -38,6 +38,7 @@ include_directories(${LWS_LIB_BUILD_INC_PATHS}) link_libraries(${LIB_LIST_AT_END}) SUBDIRLIST(SUBDIRS "${PROJECT_SOURCE_DIR}/minimal-examples") + FOREACH(subdir ${SUBDIRS}) SUBDIRLIST(SUBDIRS2 "${PROJECT_SOURCE_DIR}/minimal-examples/${subdir}") diff --git a/minimal-examples/README.md b/minimal-examples/README.md index 956256d53..73725721b 100644 --- a/minimal-examples/README.md +++ b/minimal-examples/README.md @@ -1,89 +1,9 @@ -|name|demonstrates| ----|--- -client-server|Minimal examples providing client and server connections simultaneously -crypto|Minimal examples related to using lws crypto apis -dbus-server|Minimal examples showing how to integrate DBUS into lws event loop -http-client|Minimal examples providing an http client -http-server|Minimal examples providing an http server -raw|Minimal examples related to adopting raw file or socket descriptors into the event loop -secure-streams|Minimal examples related to the Secure Streams client api -ws-client|Minimal examples providing a ws client -ws-server|Minimal examples providing a ws server (and an http server) +# minimal-examples -## FAQ +These are examples using the high-level Secure Streams features of lws. -### Getting started - -Build and install lws itself first (note that after installing lws on \*nix, you need to run `ldconfig` one time so the OS can learn about the new library. Lws installs in `/usr/local` by default, Debian / Ubuntu ldconfig knows to look there already, but Fedora / CentOS need you to add the line `/usr/local/lib` to `/etc/ld.so.conf` and run ldconfig) - -Then start with the simplest: - -`http-server/minimal-http-server` - -### Why are most of the sources split into a main C file file and a protocol file? - -Lws supports three ways to implement the protocol callback code: - - - you can just add it all in the same source file - - - you can separate it as these examples do, and #include it - into the main sources - - - you can build it as a standalone plugin that is discovered - and loaded at runtime. - -The way these examples are structured, you can easily also build -the protocol callback as a plugin just with a different -CMakeLists.txt... see https://github.com/warmcat/libwebsockets/tree/master/plugin-standalone -for an example. - -### Why would we want the protocol as a plugin? - -You will notice a lot of the main C code is the same boilerplate -repeated for each example. The actual interesting part is in -the protocol callback only. - -Lws provides (-DLWS_WITH_LWSWS=1) a generic lightweight server app called 'lwsws' that -can be configured by JSON. Combined with your protocol as a plugin, -it means you don't actually have to make a special server "app" -part, you can just use lwsws and pass per-vhost configuration -from JSON into your protocol. (Of course in some cases you have -an existing app you are bolting lws on to, then you don't care -about this for that particular case). - -Because lwsws has no dependency on whatever your plugin does, it -can mix and match different protocols randomly without needing any code -changes. It reduces the size of the task to just writing the -code you care about in your protocol handler, and nothing else to write -or maintain. - -Lwsws supports advanced features like reload, where it starts a new server -instance with changed config or different plugins, while keeping the old -instance around until the last connection to it closes. - -### I get why there is a pss, but why is there a vhd? - -The pss is instantiated per-connection. But there are almost always -other variables that have a lifetime longer than a single connection. - -You could make these variables "filescope" one-time globals, but that -means your protocol cannot instantiate multiple times. - -Lws supports vhosts (virtual hosts), for example both https://warmcat.com -and https://libwebsockets are running on the same lwsws instance on the -same server and same IP... each of these is a separate vhost. - -Your protocol may be enabled on multiple vhosts, each of these vhosts -provides a different vhd specific to the protocol instance on that -vhost. For example many of the samples keep a linked-list head to -a list of live pss in the vhd... that means it's cleanly a list of -pss opened **on that vhost**. If another vhost has the protocol -enabled, connections to that will point to a different vhd, and the -linked-list head on that vhd will only list connections to his vhost. - -The example "ws-server/minimal-ws-server-threads" demonstrates how to deliver -external configuration data to a specific vhost + protocol -combination using code. In lwsws, this is simply a matter of setting -the desired JSON config. +There are lower-level examples in `./minimal-examples-lowlevel` that +cover more usecases. However the capability of Secure Streams is +continuing to cover more cases and it is quite a bit simpler to use. diff --git a/minimal-examples/client/binance/CMakeLists.txt b/minimal-examples/client/binance/CMakeLists.txt new file mode 100644 index 000000000..d9897a1f0 --- /dev/null +++ b/minimal-examples/client/binance/CMakeLists.txt @@ -0,0 +1,53 @@ +project(lws-minimal-ss-binance C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckIncludeFile) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(SRCS main.c binance-ss.c) + +set(requirements 1) +require_lws_config(LWS_ROLE_WS 1 requirements) +require_lws_config(LWS_WITH_CLIENT 1 requirements) +require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) + +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 has_ss_proxy) + +if (requirements) + add_executable(${PROJECT_NAME} ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API) + + add_compile_options(-DLWS_SS_USE_SSPC) + add_executable(${PROJECT_NAME}-client ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME}-client + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME}-client + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME}-client + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + endif() + + +endif() diff --git a/minimal-examples/client/binance/README.md b/minimal-examples/client/binance/README.md new file mode 100644 index 000000000..5155ddd99 --- /dev/null +++ b/minimal-examples/client/binance/README.md @@ -0,0 +1,56 @@ +# lws minimal secure streams binance + +This is a Secure Streams version of minimal-ws-client-binance. + +"policy.json" contains all the information about endpoints, protocols and +connection validation, tagged by streamtype name. + +The example tries to load it from the cwd, it lives in +./minimal-examples/secure-streams/minimal-secure-streams-binance dir, so +either run it from there, or copy the policy.json to your cwd. It's also +possible to put the policy json in the code as a string and pass that at +context creation time. + +The secure stream object represents a nailed-up connection that outlives any +single socket connection, and can manage reconnections / retries according to +the policy to keep the connection nailed up automatically. + +Secure Streams provides the same simplified communication api without any +protocol dependencies. + +## build + +Lws must have been built with `LWS_ROLE_WS=1`, `LWS_WITH_SECURE_STREAMS=1`, and +`LWS_WITHOUT_EXTENSIONS=0` + +``` + $ cmake . && make +``` + +## Commandline Options + +Option|Meaning +---|--- +-d|Set logging verbosity + +## usage + +``` +$ ./bin/lws-minimal-ws-client-binance +[2021/08/15 06:42:40:8409] U: LWS minimal Secure Streams binance client +[2021/08/15 06:42:40:8410] N: LWS: 4.2.99-v4.2.0-156-g8f352f65e8, NET CLI SRV H1 H2 WS SS-JSON-POL SSPROX ConMon FLTINJ IPV6-on +[2021/08/15 06:42:40:8410] N: ++ [495958|wsi|0|pipe] (1) +[2021/08/15 06:42:40:8411] N: ++ [495958|vh|0|netlink] (1) +[2021/08/15 06:42:40:8433] N: ++ [495958|vh|1|digicert||-1] (2) +[2021/08/15 06:42:40:8471] N: ++ [495958|wsiSScli|0|binance] (1) +[2021/08/15 06:42:40:8471] N: [495958|wsiSScli|0|binance]: lws_ss_check_next_state_ss: (unset) -> LWSSSCS_CREATING +[2021/08/15 06:42:40:8472] N: [495958|wsiSScli|0|binance]: lws_ss_check_next_state_ss: LWSSSCS_CREATING -> LWSSSCS_CONNECTING +[2021/08/15 06:42:40:8472] N: ++ [495958|wsicli|0|WS/h1/fstream.binance.com/([495958|wsiSScli|0|binance])] (1) +[2021/08/15 06:42:41:8802] N: [495958|wsiSScli|0|binance]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTING -> LWSSSCS_CONNECTED +[2021/08/15 06:42:42:8803] N: sul_hz_cb: price: min: 4669185¢, max: 4672159¢, avg: 4670061¢, (53 prices/s) +[2021/08/15 06:42:42:8803] N: sul_hz_cb: elatency: min: 131ms, max: 292ms, avg: 154ms, (53 msg/s) +[2021/08/15 06:42:43:8803] N: sul_hz_cb: price: min: 4669646¢, max: 4672159¢, avg: 4669953¢, (34 prices/s) +[2021/08/15 06:42:43:8803] N: sul_hz_cb: elatency: min: 130ms, max: 149ms, avg: 133ms, (34 msg/s) +[2021/08/15 06:42:44:8804] N: sul_hz_cb: price: min: 4669455¢, max: 4672159¢, avg: 4669904¢, (26 prices/s) +... +``` diff --git a/minimal-examples/client/binance/binance-ss.c b/minimal-examples/client/binance/binance-ss.c new file mode 100644 index 000000000..e428d04dd --- /dev/null +++ b/minimal-examples/client/binance/binance-ss.c @@ -0,0 +1,203 @@ +/* + * lws-minimal-secure-streams-binance + * + * Written in 2010-2021 by Andy Green + * Kutoga + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * This demonstrates a Secure Streams implementation of a client that connects + * to binance ws server efficiently. + * + * Build lws with -DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITHOUT_EXTENSIONS=0 + * + * "policy.json" contains all the information about endpoints, protocols and + * connection validation, tagged by streamtype name. + * + * The example tries to load it from the cwd, it lives + * in ./minimal-examples/secure-streams/minimal-secure-streams-binance dir, so + * either run it from there, or copy the policy.json to your cwd. It's also + * possible to put the policy json in the code as a string and pass that at + * context creation time. + */ + +#include +#include +#include +#include + +extern int test_result; + +typedef struct range { + uint64_t sum; + uint64_t lowest; + uint64_t highest; + + unsigned int samples; +} range_t; + +LWS_SS_USER_TYPEDEF + lws_sorted_usec_list_t sul_hz; /* 1hz summary dump */ + + range_t e_lat_range; + range_t price_range; +} binance_t; + + +static void +range_reset(range_t *r) +{ + r->sum = r->highest = 0; + r->lowest = 999999999999ull; + r->samples = 0; +} + +static uint64_t +get_us_timeofday(void) +{ + struct timeval tv; + + gettimeofday(&tv, NULL); + + return (uint64_t)((lws_usec_t)tv.tv_sec * LWS_US_PER_SEC) + + (uint64_t)tv.tv_usec; +} + +static uint64_t +pennies(const char *s) +{ + uint64_t price = (uint64_t)atoll(s) * 100; + + s = strchr(s, '.'); + + if (s && isdigit(s[1]) && isdigit(s[2])) + price = price + (uint64_t)((10 * (s[1] - '0')) + (s[2] - '0')); + + return price; +} + +static void +sul_hz_cb(lws_sorted_usec_list_t *sul) +{ + binance_t *bin = lws_container_of(sul, binance_t, sul_hz); + + /* + * We are called once a second to dump statistics on the connection + */ + + lws_sul_schedule(lws_ss_get_context(bin->ss), 0, &bin->sul_hz, + sul_hz_cb, LWS_US_PER_SEC); + + if (bin->price_range.samples) + lwsl_ss_user(lws_ss_from_user(bin), + "price: min: %llu¢, max: %llu¢, avg: %llu¢, " + "(%d prices/s)", + (unsigned long long)bin->price_range.lowest, + (unsigned long long)bin->price_range.highest, + (unsigned long long)(bin->price_range.sum / + bin->price_range.samples), + bin->price_range.samples); + if (bin->e_lat_range.samples) + lwsl_ss_user(lws_ss_from_user(bin), + "elatency: min: %llums, max: %llums, " + "avg: %llums, (%d msg/s)", + (unsigned long long)bin->e_lat_range.lowest / 1000, + (unsigned long long)bin->e_lat_range.highest / 1000, + (unsigned long long)(bin->e_lat_range.sum / + bin->e_lat_range.samples) / 1000, + bin->e_lat_range.samples); + + range_reset(&bin->e_lat_range); + range_reset(&bin->price_range); + + test_result = 0; +} + + +static lws_ss_state_return_t +binance_rx(void *userobj, const uint8_t *in, size_t len, int flags) +{ + binance_t *bin = (binance_t *)userobj; + uint64_t latency_us, now_us; + char numbuf[16]; + uint64_t price; + const char *p; + size_t alen; + + now_us = (uint64_t)get_us_timeofday(); + + p = lws_json_simple_find((const char *)in, len, "\"depthUpdate\"", + &alen); + if (!p) + return LWSSSSRET_OK; + + p = lws_json_simple_find((const char *)in, len, "\"E\":", &alen); + if (!p) { + lwsl_err("%s: no E JSON\n", __func__); + return LWSSSSRET_OK; + } + + lws_strnncpy(numbuf, p, alen, sizeof(numbuf)); + latency_us = now_us - ((uint64_t)atoll(numbuf) * LWS_US_PER_MS); + + if (latency_us < bin->e_lat_range.lowest) + bin->e_lat_range.lowest = latency_us; + if (latency_us > bin->e_lat_range.highest) + bin->e_lat_range.highest = latency_us; + + bin->e_lat_range.sum += latency_us; + bin->e_lat_range.samples++; + + p = lws_json_simple_find((const char *)in, len, "\"a\":[[\"", &alen); + if (!p) + return LWSSSSRET_OK; + + lws_strnncpy(numbuf, p, alen, sizeof(numbuf)); + price = pennies(numbuf); + + if (price < bin->price_range.lowest) + bin->price_range.lowest = price; + if (price > bin->price_range.highest) + bin->price_range.highest = price; + + bin->price_range.sum += price; + bin->price_range.samples++; + + return LWSSSSRET_OK; +} + +static lws_ss_state_return_t +binance_state(void *userobj, void *h_src, lws_ss_constate_t state, + lws_ss_tx_ordinal_t ack) +{ + binance_t *bin = (binance_t *)userobj; + + lwsl_ss_info(bin->ss, "%s (%d), ord 0x%x", + lws_ss_state_name((int)state), state, (unsigned int)ack); + + switch (state) { + + case LWSSSCS_CONNECTED: + lws_sul_schedule(lws_ss_get_context(bin->ss), 0, &bin->sul_hz, + sul_hz_cb, LWS_US_PER_SEC); + range_reset(&bin->e_lat_range); + range_reset(&bin->price_range); + + return LWSSSSRET_OK; + + case LWSSSCS_DISCONNECTED: + lws_sul_cancel(&bin->sul_hz); + break; + + default: + break; + } + + return LWSSSSRET_OK; +} + +LWS_SS_INFO("binance", binance_t) + .rx = binance_rx, + .state = binance_state, +}; diff --git a/minimal-examples/client/binance/example-policy.json b/minimal-examples/client/binance/example-policy.json new file mode 100644 index 000000000..1ff4e0413 --- /dev/null +++ b/minimal-examples/client/binance/example-policy.json @@ -0,0 +1,38 @@ +{ + "release": "01234567", + "product": "myproduct", + "schema-version": 1, + "retry": [{ + "default": { + "backoff": [1000, 2000, 3000, 4000, 5000], + "conceal": 65535, + "jitterpc": 20, + "svalidping": 30, + "svalidhup": 35 + } + }], + "certs": [{ + "digicert_global_root": "MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQkCAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=" + } + ], + "trust_stores": [{ + "name": "digicert", + "stack": ["digicert_global_root"] + } + ], + "s": [ + { "binance": { + "endpoint": "fstream.binance.com", + "port": 443, + "protocol": "ws", + "http_url": "/stream?streams=btcusdt@depth@0ms/btcusdt@bookTicker/btcusdt@aggTrade", + "nailed_up": true, + "ws_prioritize_reads": true, + "tls": true, + "tls_trust_store": "digicert", + "retry": "default" + } + } + ] +} + diff --git a/minimal-examples/client/binance/main.c b/minimal-examples/client/binance/main.c new file mode 100644 index 000000000..fad9a59b9 --- /dev/null +++ b/minimal-examples/client/binance/main.c @@ -0,0 +1,79 @@ +/* + * lws-minimal-secure-streams-binance + * + * Written in 2010-2021 by Andy Green + * Kutoga + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * This demonstrates a Secure Streams implementation of a client that connects + * to binance ws server efficiently. + * + * Build lws with -DLWS_WITH_SECURE_STREAMS=1 -DLWS_WITHOUT_EXTENSIONS=0 + * + * "example-policy.json" contains all the information about endpoints, protocols + * and connection validation, tagged by streamtype name. + * + * The example tries to load it from the cwd, it lives + * in ./minimal-examples/client/binance dir, so either run it from there, or + * copy the example-policy.json to your cwd. It's also possible to put the + * policy json in the code as a string and pass that at context creation time. + * + * When built to use the SSPC proxy, the local policy is not used since the + * proxy takes care of that. + */ + +#include +#include + +static struct lws_context *cx; +static int interrupted; +int test_result = 1; + +extern const lws_ss_info_t ssi_binance_t; + +static const struct lws_extension extensions[] = { + { + "permessage-deflate", lws_extension_callback_pm_deflate, + "permessage-deflate" "; client_no_context_takeover" + "; client_max_window_bits" + }, + { NULL, NULL, NULL /* terminator */ } +}; + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + + lws_context_info_defaults(&info, "example-policy.json"); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + lwsl_user("LWS minimal Secure Streams binance client\n"); + + info.extensions = extensions; + + cx = lws_create_context(&info); + if (!cx) { + lwsl_err("lws init failed\n"); + return 1; + } + + if (lws_ss_create(cx, 0, &ssi_binance_t, NULL, NULL, NULL, NULL)) { + lwsl_cx_err(cx, "failed to create secure stream"); + interrupted = 1; + } + + lws_context_default_loop_run_destroy(cx); + + /* process ret 0 if actual is as expected (0, or--expected-exit 123) */ + + return lws_cmdline_passfail(argc, argv, test_result); +} diff --git a/minimal-examples/client/hello_world/CMakeLists.txt b/minimal-examples/client/hello_world/CMakeLists.txt new file mode 100644 index 000000000..632117210 --- /dev/null +++ b/minimal-examples/client/hello_world/CMakeLists.txt @@ -0,0 +1,193 @@ +project(lws-minimal-ss-hello_world C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(requirements 1) +require_lws_config(LWS_ROLE_H1 1 requirements) +require_lws_config(LWS_WITHOUT_CLIENT 0 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY 0 requirements) + +require_lws_config(LWS_WITH_SYS_FAULT_INJECTION 1 has_fault_injection) +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 has_ss_proxy) +require_lws_config(LWS_WITH_SYS_STATE 1 has_sys_state) + +CHECK_C_SOURCE_COMPILES("#include \nint main(void) {\ni#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)\n return 0;\n #else\n fail\n #endif\n return 0;\n}\n" HAS_LWS_WITH_SECURE_STREAMS_PROXY_API) + +if (requirements) + + add_executable(lws-minimal-ss-hello_world + main.c + hello_world-ss.c) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + + ### --- this section related to also building example with SSPC / Proxy ---> + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API) + add_compile_options(-DLWS_SS_USE_SSPC) + + add_executable(${PROJECT_NAME}-client + main.c + hello_world-ss.c) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME}-client + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME}-client + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME}-client + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + endif() + + ### <--- this section related to building with SSPC / Proxy END + + + + ### ---everything else related to ctest / CI -----> + + find_program(VALGRIND "valgrind") + + if (LWS_CTEST_INTERNET_AVAILABLE AND NOT WIN32) + + # + # When running in CI, wait for a lease on the resources + # before starting this test, so the server does not get + # thousands of simultaneous tls connection attempts + # + # sai-resource holds the lease on the resources until + # the time given in seconds or the sai-resource instance + # exits, whichever happens first + # + # If running under Sai, creates a lock test called "res_sspcmin" + # + + sai_resource(warmcat_conns 1 40 sspcmin-hello-world) + + # + # simple test not via proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME mss-warmcat COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $) + else() + add_test(NAME mss-warmcat COMMAND ${PROJECT_NAME}) + endif() + + set_tests_properties(mss-warmcat + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/hello_world + TIMEOUT 40) + if (DEFINED ENV{SAI_OVN}) + set_tests_properties(mss-warmcat PROPERTIES FIXTURES_REQUIRED "res_msspcmin") + endif() + + if (has_fault_injection) + if (VALGRIND) + add_test(NAME mss-warmcat-fi1 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME mss-warmcat-fi2 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + else() + add_test(NAME mss-warmcat-fi1 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME mss-warmcat-fi2 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + endif() + + set_tests_properties(mss-warmcat-fi1 + mss-warmcat-fi2 + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/hello_world + TIMEOUT 5) + + endif() + + + if (has_sys_state AND + (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR LWS_WITH_SECURE_STREAMS_PROXY_API)) + + # + # Define test dep to bring up and take down the test + # proxy + # + + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # uds abstract namespace for linux + set(CTEST_SOCKET_PATH "@ctest-mssp-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + else() + # filesystem socket for others + set(CTEST_SOCKET_PATH "/tmp/ctest-mssp-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + endif() + add_test(NAME st_mssproxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh + mssproxy $ + -i ${CTEST_SOCKET_PATH} ) + set_tests_properties(st_mssproxy PROPERTIES WORKING_DIRECTORY . FIXTURES_SETUP mssproxy TIMEOUT 800) + + add_test(NAME ki_mssproxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh + mssproxy $ + -i ${CTEST_SOCKET_PATH}) + set_tests_properties(ki_mssproxy PROPERTIES FIXTURES_CLEANUP mssproxy) + + # + # the client part that will connect to the proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME msspc-minimal COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ --ssproxy-iface +${CTEST_SOCKET_PATH}) + else() + add_test(NAME msspc-minimal COMMAND ${PROJECT_NAME}-client --ssproxy-iface +${CTEST_SOCKET_PATH}) + endif() + + set(fixlist "mssproxy") + if (DEFINED ENV{SAI_OVN}) + list(APPEND fixlist "res_mssproxy") + endif() + + set_tests_properties(msspc-minimal PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/hello_world + FIXTURES_REQUIRED "${fixlist}" + TIMEOUT 40) + + endif() + + endif() + + ### <--- related to ctest / CI END + +endif() + diff --git a/minimal-examples/client/hello_world/README.md b/minimal-examples/client/hello_world/README.md new file mode 100644 index 000000000..d1fdc526b --- /dev/null +++ b/minimal-examples/client/hello_world/README.md @@ -0,0 +1,45 @@ +# SS Example "hello_world" + +This is the simplest example, showing how to do an https +transaction using Secure Streams (SS). + +SS' approach is to segregate "policy" (where and how to connect and authenticate +for particular kinds of connection) from payloads that are transferred on the +connection. In this case, all the information about the example's policy is in +`example-policy.json`. + +|Source|Purpose| +|---|---| +|main.c|boilerplate to create the lws_context and event loop| +|hello_world-ss.c|the secure stream user code| +|example-policy.json|the example policy| + +## Build + +You should build and install lws itself first. Then with this directory as the +cwd, you can use `cmake . && make` to build the example. This produces +`./lws-minimal-ss-hello_world`. + +If lws was configured to support SS Proxying with +`-DLWS_WITH_SECURE_STREAMS_PROXY_API=1`, then a second executable is also +produced `./lws-minimal-ss-hello_world-client`. This does not try to do its own +networking, but instead wants to connect to an SS Proxy process that will fulfil +connections itself using its own policy. + +## Running + +You should be able to run `./lws-minimal-ss-hello_world` directly and see it +fetch a webpage (just the start and end of each chunk are logged). + +To go via the SS Proxy, run `./lws-minimal-ss-hello_world-client` and an SS +Proxy, eg, the example one found in `./minimal-examples/ssproxy/ssproxy-socket`. + +## Options + +|Commandline option|Meaning| +|---|---| +|-d \|Enable logging levels (default 1031 (USER, ERR, WARN, NOTICE), 1039 = +INFO, 1151 = +INFO, DEBUG), `-DCMAKE_BUILD_TYPE=DEBUG` needed for logs more verbose that NOTICE +|--ssproxy-port \|If going via an SS Proxy, default is Unix Domain Socket @proxy.ss.lws, you can force a different proxy's TCP port with this| +|--ssproxy-ads \|Set non-default hostname or IP address proxy is on| +|--ssproxy-iface \|Set non-default UDS path if starts with +, else interface to bind TCP connection to for proxy| + diff --git a/minimal-examples/client/hello_world/example-policy.json b/minimal-examples/client/hello_world/example-policy.json new file mode 100644 index 000000000..fd3afeaa1 --- /dev/null +++ b/minimal-examples/client/hello_world/example-policy.json @@ -0,0 +1,39 @@ +{ + "release": "1", + "product": "sx-hello_world", + "schema-version": 1, + "retry": [{ + "default": { + "backoff": [1000, 2000, 3000, 5000, 10000], + "conceal": 5, + "jitterpc": 20, + "svalidping": 30, + "svalidhup": 35 + } + }], + "certs": [{ + "dst_root_x3": "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" + } + ], + "trust_stores": [{ + "name": "le_via_dst", + "stack": [ "dst_root_x3" ] + }], + "s": [ + { + "sx-hello_world": { + "endpoint": "warmcat.com", + "port": 443, + "protocol": "h2", + "http_method": "GET", + "http_url": "index.html", + "tls": true, + "opportunistic": true, + "retry": "default", + "timeout_ms": 2000, + "tls_trust_store": "le_via_dst" + } + } + ] +} + diff --git a/minimal-examples/client/hello_world/hello_world-ss.c b/minimal-examples/client/hello_world/hello_world-ss.c new file mode 100644 index 000000000..58321ec62 --- /dev/null +++ b/minimal-examples/client/hello_world/hello_world-ss.c @@ -0,0 +1,71 @@ +/* + * hello_world example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates the simplest example using the LWS high-level SS apis. + * + * - main.c: boilerplate to create the lws_context and event loop + * - hello_world-ss.c: (this file) the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +extern int test_result; + +LWS_SS_USER_TYPEDEF + /* Your per-stream instantiation members go here */ +} hello_world_t; + +static lws_ss_state_return_t +hello_world_rx(void *userobj, const uint8_t *in, size_t len, int flags) +{ + hello_world_t *g = (hello_world_t *)userobj; + + lwsl_ss_user(lws_ss_from_user(g), "RX %zu, flags 0x%x", len, + (unsigned int)flags); + + if (len) { /* log the first 16 and last 16 bytes of the chunk */ + lwsl_hexdump_notice(in, len >= 16 ? 16 : len); + if (len >= 16) + lwsl_hexdump_notice(in + len - 16, 16); + } + + if ((flags & LWSSS_FLAG_EOM) == LWSSS_FLAG_EOM) + /* We received the whole message */ + test_result &= ~2; + + return LWSSSSRET_OK; +} + +static lws_ss_state_return_t +hello_world_state(void *userobj, void *h_src, lws_ss_constate_t state, + lws_ss_tx_ordinal_t ack) +{ + hello_world_t *g = (hello_world_t *)userobj; + + switch ((int)state) { + case LWSSSCS_CREATING: /* start the transaction as soon as we exist */ + return lws_ss_request_tx(lws_ss_from_user(g)); + + case LWSSSCS_QOS_ACK_REMOTE: /* server liked our request */ + test_result &= ~1; + break; + + case LWSSSCS_DISCONNECTED: /* for our example, disconnect = done */ + lws_default_loop_exit(lws_ss_cx_from_user(g)); + break; + } + + return LWSSSSRET_OK; +} + +LWS_SS_INFO("sx-hello_world", hello_world_t) + .rx = hello_world_rx, + .state = hello_world_state, +}; diff --git a/minimal-examples/client/hello_world/main.c b/minimal-examples/client/hello_world/main.c new file mode 100644 index 000000000..739a8116d --- /dev/null +++ b/minimal-examples/client/hello_world/main.c @@ -0,0 +1,60 @@ +/* + * hello_world example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates the simplest example using the LWS high-level SS apis. + * + * - main.c: (this file) boilerplate to create the lws_context + * and event loop + * - hello_world-ss.c: the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +/* b0: clr when peer ACKed request, b1: clr when recieved whole response */ +int test_result = 3; + +extern const lws_ss_info_t ssi_hello_world_t; /* from hello_world-ss.c */ + +static struct lws_context *cx; /* so the SIGINT handler below can access it */ + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int +main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + + lws_context_info_defaults(&info, "example-policy.json"); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + lwsl_user("LWS hello_world example [-d]\n"); + + if (!(cx = lws_create_context(&info))) { + lwsl_err("lws init failed\n"); + return 1; + } + + if (lws_ss_create(cx, 0, &ssi_hello_world_t, NULL, NULL, NULL, NULL)) { + lwsl_cx_err(cx, "failed to create get secure stream"); + lws_context_destroy(cx); + return 1; + } + + lws_context_default_loop_run_destroy(cx); + + /* process ret 0 if actual is as expected (0, or--expected-exit 123) */ + + return lws_cmdline_passfail(argc, argv, test_result); +} diff --git a/minimal-examples/client/http-post/CMakeLists.txt b/minimal-examples/client/http-post/CMakeLists.txt new file mode 100644 index 000000000..6a4a47a19 --- /dev/null +++ b/minimal-examples/client/http-post/CMakeLists.txt @@ -0,0 +1,198 @@ +project(lws-minimal-ss-http-post C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(requirements 1) +require_lws_config(LWS_ROLE_H1 1 requirements) +require_lws_config(LWS_WITHOUT_CLIENT 0 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY 0 requirements) + +require_lws_config(LWS_WITH_SYS_FAULT_INJECTION 1 has_fault_injection) +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 has_ss_proxy) +require_lws_config(LWS_WITH_SYS_STATE 1 has_sys_state) + +CHECK_C_SOURCE_COMPILES("#include \nint main(void) {\ni#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)\n return 0;\n #else\n fail\n #endif\n return 0;\n}\n" HAS_LWS_WITH_SECURE_STREAMS_PROXY_API) + +if (requirements) + + set(SRCS main.c http-post-ss.c) + + add_executable(${PROJECT_NAME} ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + + ### --- this section related to also building example with SSPC / Proxy ---> + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API) + add_compile_options(-DLWS_SS_USE_SSPC) + + add_executable(${PROJECT_NAME}-client ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME}-client + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME}-client + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME}-client + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + endif() + + ### <--- this section related to building with SSPC / Proxy END + + + + ### ---everything else related to ctest / CI -----> + + find_program(VALGRIND "valgrind") + + if (LWS_CTEST_INTERNET_AVAILABLE AND NOT WIN32) + + # + # When running in CI, wait for a lease on the resources + # before starting this test, so the server does not get + # thousands of simultaneous tls connection attempts + # + # sai-resource holds the lease on the resources until + # the time given in seconds or the sai-resource instance + # exits, whichever happens first + # + # If running under Sai, creates a lock test called "res_sspcmin" + # + + sai_resource(warmcat_conns 1 40 sspcmin-http-post) + + # + # simple test not via proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME msshttp-post-warmcat COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $) + else() + add_test(NAME msshttp-post-warmcat COMMAND ${PROJECT_NAME}) + endif() + + set_tests_properties(msshttp-post-warmcat + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/http-post + TIMEOUT 40) + if (DEFINED ENV{SAI_OVN}) + set_tests_properties(msshttp-post-warmcat PROPERTIES FIXTURES_REQUIRED "res_msspcmin") + endif() + + if (has_fault_injection) + if (VALGRIND) + add_test(NAME msshttp-post-warmcat-fi1 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME msshttp-post-warmcat-fi2 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + else() + add_test(NAME msshttp-post-warmcat-fi1 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME msshttp-post-warmcat-fi2 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + endif() + + set_tests_properties(msshttp-post-warmcat-fi1 + msshttp-post-warmcat-fi2 + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/http-post + TIMEOUT 5) + + endif() + + + if (has_sys_state AND (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API)) + + # + # Define test dep to bring up and take down the test + # proxy + # + + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # uds abstract namespace for linux + set(CTEST_SOCKET_PATH "@ctest-mssphttp-post--$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + else() + # filesystem socket for others + set(CTEST_SOCKET_PATH "/tmp/ctest-mssphttp-post-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + endif() + add_test(NAME st_msshttp-post-proxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh + msshttp-post-proxy $ + -i ${CTEST_SOCKET_PATH} ) + set_tests_properties(st_msshttp-post-proxy PROPERTIES + WORKING_DIRECTORY . + FIXTURES_SETUP msshttp-post-proxy + TIMEOUT 800) + + add_test(NAME ki_msshttp-post-proxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh + msshttp-post-proxy $ + -i ${CTEST_SOCKET_PATH}) + set_tests_properties(ki_msshttp-post-proxy PROPERTIES + FIXTURES_CLEANUP msshttp-post-proxy) + + # + # the client part that will connect to the proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME msspc-http-post-minimal COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --ssproxy-iface +${CTEST_SOCKET_PATH}) + else() + add_test(NAME msspc-http-post-minimal COMMAND + ${PROJECT_NAME}-client + --ssproxy-iface +${CTEST_SOCKET_PATH}) + endif() + + set(fixlist "msshttp-post-proxy") + if (DEFINED ENV{SAI_OVN}) + list(APPEND fixlist "res_msshttp-post-proxy") + endif() + + set_tests_properties(msspc-http-post-minimal PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/http-post + FIXTURES_REQUIRED "${fixlist}" + TIMEOUT 40) + + endif() + + endif() + + ### <--- related to ctest / CI END + +endif() + diff --git a/minimal-examples/client/http-post/README.md b/minimal-examples/client/http-post/README.md new file mode 100644 index 000000000..d1fdc526b --- /dev/null +++ b/minimal-examples/client/http-post/README.md @@ -0,0 +1,45 @@ +# SS Example "hello_world" + +This is the simplest example, showing how to do an https +transaction using Secure Streams (SS). + +SS' approach is to segregate "policy" (where and how to connect and authenticate +for particular kinds of connection) from payloads that are transferred on the +connection. In this case, all the information about the example's policy is in +`example-policy.json`. + +|Source|Purpose| +|---|---| +|main.c|boilerplate to create the lws_context and event loop| +|hello_world-ss.c|the secure stream user code| +|example-policy.json|the example policy| + +## Build + +You should build and install lws itself first. Then with this directory as the +cwd, you can use `cmake . && make` to build the example. This produces +`./lws-minimal-ss-hello_world`. + +If lws was configured to support SS Proxying with +`-DLWS_WITH_SECURE_STREAMS_PROXY_API=1`, then a second executable is also +produced `./lws-minimal-ss-hello_world-client`. This does not try to do its own +networking, but instead wants to connect to an SS Proxy process that will fulfil +connections itself using its own policy. + +## Running + +You should be able to run `./lws-minimal-ss-hello_world` directly and see it +fetch a webpage (just the start and end of each chunk are logged). + +To go via the SS Proxy, run `./lws-minimal-ss-hello_world-client` and an SS +Proxy, eg, the example one found in `./minimal-examples/ssproxy/ssproxy-socket`. + +## Options + +|Commandline option|Meaning| +|---|---| +|-d \|Enable logging levels (default 1031 (USER, ERR, WARN, NOTICE), 1039 = +INFO, 1151 = +INFO, DEBUG), `-DCMAKE_BUILD_TYPE=DEBUG` needed for logs more verbose that NOTICE +|--ssproxy-port \|If going via an SS Proxy, default is Unix Domain Socket @proxy.ss.lws, you can force a different proxy's TCP port with this| +|--ssproxy-ads \|Set non-default hostname or IP address proxy is on| +|--ssproxy-iface \|Set non-default UDS path if starts with +, else interface to bind TCP connection to for proxy| + diff --git a/minimal-examples/client/http-post/example-policy.json b/minimal-examples/client/http-post/example-policy.json new file mode 100644 index 000000000..2e1698c74 --- /dev/null +++ b/minimal-examples/client/http-post/example-policy.json @@ -0,0 +1,42 @@ +{ + "release": "1", + "product": "sx-http-post", + "schema-version": 1, + "retry": [{ + "default": { + "backoff": [1000, 2000, 3000, 5000, 10000], + "conceal": 5, + "jitterpc": 20, + "svalidping": 30, + "svalidhup": 35 + } + }], + "certs": [{ + "dst_root_x3": "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" + } + ], + "trust_stores": [{ + "name": "le_via_dst", + "stack": [ "dst_root_x3" ] + }], + "s": [ + { + "minpost": { + "endpoint": "libwebsockets.org", + "port": 443, + "protocol": "h1", + "http_method": "POST", + "http_url": "testserver/formtest", + "metadata": [ + { "ctype": "Content-Type:" } + ], + "tls": true, + "opportunistic": true, + "allow_redirects": true, + "retry": "default", + "tls_trust_store": "le_via_dst" + } + } + ] +} + diff --git a/minimal-examples/client/http-post/http-post-ss.c b/minimal-examples/client/http-post/http-post-ss.c new file mode 100644 index 000000000..814772f27 --- /dev/null +++ b/minimal-examples/client/http-post/http-post-ss.c @@ -0,0 +1,214 @@ +/* + * SS http-post example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates http post using the LWS high-level SS apis. + * + * - main.c: boilerplate to create the lws_context and event loop + * - http-post-ss.c: (this file) the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +extern int test_result; + +static const char * const postbody = + "--boundary\r\n" + "Content-Disposition: form-data; name=\"text\"\r\n" + "\r\n" + "value1\r\n" + "--boundary\r\n" + "Content-Disposition: form-data; " + "name=\"field2\"; filename=\"example.txt\"\r\n" + "\r\n" + "value2\r\n" + "00-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "01-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "02-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "03-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "04-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "05-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "06-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "07-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "08-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "09-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0a-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0b-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0c-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0d-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0e-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "0f-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "10-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "11-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "12-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "13-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "14-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "15-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "16-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "17-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "18-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "19-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1a-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1b-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1c-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1d-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1e-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "1f-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "20-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "21-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "22-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "23-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "24-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "25-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "26-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "27-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "28-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "29-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2a-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2b-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2c-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2d-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2e-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "2f-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "30-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "31-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "32-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "33-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "34-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "35-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "36-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "37-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "38-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "39-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3a-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3b-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3c-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3d-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3e-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "3f-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "40-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "41-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "42-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "43-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "44-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "45-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "46-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "47-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "48-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "49-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4a-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4b-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4c-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4d-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4e-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "4f-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "50-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "51-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "52-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "53-0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef\r\n" + "--boundary--\r\n"; + +LWS_SS_USER_TYPEDEF + const char *payload; + size_t size; + size_t pos; +} http_post_t; + +static lws_ss_state_return_t +http_post_tx(void *userobj, lws_ss_tx_ordinal_t ord, uint8_t *buf, size_t *len, + int *flags) +{ + http_post_t *g = (http_post_t *)userobj; + lws_ss_state_return_t r = LWSSSSRET_OK; + + if (g->size == g->pos) + return LWSSSSRET_TX_DONT_SEND; + + if (*len > g->size - g->pos) + *len = g->size - g->pos; + + if (!g->pos) + *flags |= LWSSS_FLAG_SOM; + + memcpy(buf, g->payload + g->pos, *len); + g->pos += *len; + + if (g->pos != g->size) + /* more to do */ + r = lws_ss_request_tx(lws_ss_from_user(g)); + else + *flags |= LWSSS_FLAG_EOM; + + lwsl_ss_user(lws_ss_from_user(g), "TX %zu, flags 0x%x, r %d", *len, + (unsigned int)*flags, (int)r); + + return r; +} + +static lws_ss_state_return_t +http_post_rx(void *userobj, const uint8_t *in, size_t len, int flags) +{ + http_post_t *g = (http_post_t *)userobj; + + lwsl_ss_user(lws_ss_from_user(g), "RX %zu, flags 0x%x", len, + (unsigned int)flags); + + lwsl_hexdump_notice(in, len); + + if ((flags & LWSSS_FLAG_EOM) == LWSSS_FLAG_EOM) + /* We received the whole response */ + test_result &= ~2; + + return LWSSSSRET_OK; +} + +static lws_ss_state_return_t +http_post_state(void *userobj, void *h_src, lws_ss_constate_t state, + lws_ss_tx_ordinal_t ack) +{ + http_post_t *g = (http_post_t *)userobj; + + switch ((int)state) { + case LWSSSCS_CREATING: + if (lws_ss_set_metadata(lws_ss_from_user(g), "ctype", + "multipart/form-data;boundary=\"boundary\"", + 39)) + return LWSSSSRET_DISCONNECT_ME; + + /* provide a hint about the payload size */ + g->pos = 0; + g->payload = postbody; + g->size = strlen(g->payload); + + lwsl_ss_user(lws_ss_from_user(g), "Preparing to send %zu", + g->size); + + return lws_ss_request_tx_len(lws_ss_from_user(g), + (unsigned long)g->size); + + case LWSSSCS_CONNECTED: + return lws_ss_request_tx(lws_ss_from_user(g)); + + case LWSSSCS_QOS_ACK_REMOTE: /* server liked our request */ + test_result &= ~1; + break; + + case LWSSSCS_DISCONNECTED: /* for our example, disconnect = done */ + lws_default_loop_exit(lws_ss_cx_from_user(g)); + break; + } + + return LWSSSSRET_OK; +} + +LWS_SS_INFO("minpost", http_post_t) + .tx = http_post_tx, + .rx = http_post_rx, + .state = http_post_state, +}; diff --git a/minimal-examples/client/http-post/main.c b/minimal-examples/client/http-post/main.c new file mode 100644 index 000000000..402a15c7f --- /dev/null +++ b/minimal-examples/client/http-post/main.c @@ -0,0 +1,60 @@ +/* + * http post example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates http post using the LWS high-level SS apis. + * + * - main.c: (this file) boilerplate to create the lws_context + * and event loop + * - http-post-ss.c: the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +/* b0: clr when peer ACKed request, b1: clr when recieved whole response */ +int test_result = 3; + +extern const lws_ss_info_t ssi_http_post_t; /* from hello_world-ss.c */ + +static struct lws_context *cx; /* so the SIGINT handler below can access it */ + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int +main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + + lws_context_info_defaults(&info, "example-policy.json"); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + lwsl_user("LWS SS http-post example [-d]\n"); + + if (!(cx = lws_create_context(&info))) { + lwsl_err("lws init failed\n"); + return 1; + } + + if (lws_ss_create(cx, 0, &ssi_http_post_t, NULL, NULL, NULL, NULL)) { + lwsl_cx_err(cx, "failed to create get secure stream"); + lws_context_destroy(cx); + return 1; + } + + lws_context_default_loop_run_destroy(cx); + + /* process ret 0 if actual is as expected (0, or--expected-exit 123) */ + + return lws_cmdline_passfail(argc, argv, test_result); +} diff --git a/minimal-examples/client/ws-echo/CMakeLists.txt b/minimal-examples/client/ws-echo/CMakeLists.txt new file mode 100644 index 000000000..86759e4bb --- /dev/null +++ b/minimal-examples/client/ws-echo/CMakeLists.txt @@ -0,0 +1,194 @@ +project(lws-minimal-ss-ws-echo C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(requirements 1) +require_lws_config(LWS_ROLE_H1 1 requirements) +require_lws_config(LWS_WITHOUT_CLIENT 0 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY 0 requirements) + +require_lws_config(LWS_WITH_SYS_FAULT_INJECTION 1 has_fault_injection) +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 has_ss_proxy) +require_lws_config(LWS_WITH_SYS_STATE 1 has_sys_state) + +CHECK_C_SOURCE_COMPILES("#include \nint main(void) {\ni#if defined(LWS_WITH_SECURE_STREAMS_PROXY_API)\n return 0;\n #else\n fail\n #endif\n return 0;\n}\n" HAS_LWS_WITH_SECURE_STREAMS_PROXY_API) + +if (requirements) + + set(SRCS main.c ws-echo-ss.c) + + add_executable(${PROJECT_NAME} ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + + ### --- this section related to also building example with SSPC / Proxy ---> + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API) + add_compile_options(-DLWS_SS_USE_SSPC) + + add_executable(${PROJECT_NAME}-client ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME}-client + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME}-client + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME}-client + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + endif() + + ### <--- this section related to building with SSPC / Proxy END + + + + ### ---everything else related to ctest / CI -----> + + find_program(VALGRIND "valgrind") + + if (LWS_CTEST_INTERNET_AVAILABLE AND NOT WIN32) + + # + # When running in CI, wait for a lease on the resources + # before starting this test, so the server does not get + # thousands of simultaneous tls connection attempts + # + # sai-resource holds the lease on the resources until + # the time given in seconds or the sai-resource instance + # exits, whichever happens first + # + # If running under Sai, creates a lock test called "res_sspcmin" + # + + sai_resource(warmcat_conns 1 40 sspcmin-ws-echo) + + # + # simple test not via proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME mssws_echo-warmcat COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $) + else() + add_test(NAME mssws_echo-warmcat COMMAND ${PROJECT_NAME}) + endif() + + set_tests_properties(mssws_echo-warmcat + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/ws-echo + TIMEOUT 40) + if (DEFINED ENV{SAI_OVN}) + set_tests_properties(mssws_echo-warmcat PROPERTIES FIXTURES_REQUIRED "res_msspcmin") + endif() + + if (has_fault_injection) + if (VALGRIND) + add_test(NAME mssws_echo-warmcat-fi1 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME mssws_echo-warmcat-fi2 COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + else() + add_test(NAME mssws_echo-warmcat-fi1 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_create_destroy_me" + --expected-exit 1) + add_test(NAME mssws_echo-warmcat-fi2 COMMAND lws-minimal-secure-streams + --fault-injection "ss/ss_no_streamtype_policy" + --expected-exit 1) + endif() + + set_tests_properties(mssws_echo-warmcat-fi1 + mssws_echo-warmcat-fi2 + PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/ws-echo + TIMEOUT 5) + + endif() + + + if (has_sys_state AND (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API)) + + # + # Define test dep to bring up and take down the test + # proxy + # + + if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") + # uds abstract namespace for linux + set(CTEST_SOCKET_PATH "@ctest-msspws_echo--$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + else() + # filesystem socket for others + set(CTEST_SOCKET_PATH "/tmp/ctest-msspws_echo-$ENV{SAI_PROJECT}-$ENV{SAI_OVN}") + endif() + add_test(NAME st_mssws_echo-proxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background.sh + mssws_echo-proxy $ + -i ${CTEST_SOCKET_PATH} ) + set_tests_properties(st_mssws_echo-proxy PROPERTIES WORKING_DIRECTORY . FIXTURES_SETUP mssws_echo-proxy TIMEOUT 800) + + add_test(NAME ki_mssws_echo-proxy COMMAND + ${CMAKE_SOURCE_DIR}/scripts/ctest-background-kill.sh + mssws_echo-proxy $ + -i ${CTEST_SOCKET_PATH}) + set_tests_properties(ki_mssws_echo-proxy PROPERTIES FIXTURES_CLEANUP mssws_echo-proxy) + + # + # the client part that will connect to the proxy + # + + if (VALGRIND) + message("testing via valgrind") + add_test(NAME msspcws-echo-minimal COMMAND + ${VALGRIND} --tool=memcheck --leak-check=yes --num-callers=20 + $ + --ssproxy-iface +${CTEST_SOCKET_PATH}) + else() + add_test(NAME msspcws-echo-minimal COMMAND + ${PROJECT_NAME}-client + --ssproxy-iface +${CTEST_SOCKET_PATH}) + endif() + + set(fixlist "mssws_echo-proxy") + if (DEFINED ENV{SAI_OVN}) + list(APPEND fixlist "res_mssws_echo-proxy") + endif() + + set_tests_properties(msspcws-echo-minimal PROPERTIES + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/client/ws-echo + FIXTURES_REQUIRED "${fixlist}" + TIMEOUT 40) + + endif() + + endif() + + ### <--- related to ctest / CI END + +endif() + diff --git a/minimal-examples/client/ws-echo/README.md b/minimal-examples/client/ws-echo/README.md new file mode 100644 index 000000000..9ea8d4c76 --- /dev/null +++ b/minimal-examples/client/ws-echo/README.md @@ -0,0 +1,44 @@ +# SS Example "ws-echo" + +This shows a client doing ws echo, using Secure Streams. + +SS' approach is to segregate "policy" (where and how to connect and authenticate +for particular kinds of connection) from payloads that are transferred on the +connection. In this case, all the information about the example's policy is in +`example-policy.json`. + +|Source|Purpose| +|---|---| +|main.c|boilerplate to create the lws_context and event loop| +|ws-echo-ss.c|the secure stream user code| +|example-policy.json|the example policy| + +## Build + +You should build and install lws itself first. Then with this directory as the +cwd, you can use `cmake . && make` to build the example. This produces +`./lws-minimal-ss-ws-echo`. + +If lws was configured to support SS Proxying with +`-DLWS_WITH_SECURE_STREAMS_PROXY_API=1`, then a second executable is also +produced `./lws-minimal-ss-ws-echo-client`. This does not try to do its own +networking, but instead wants to connect to an SS Proxy process that will fulfil +connections itself using its own policy. + +## Running + +You should be able to run the example directly and see it start to send ws +messages every 500ms, and receive them back from the lws mirror server. + +To go via the SS Proxy, run `./lws-minimal-ss-ws-echo-client` and an SS +Proxy, eg, the example one found in `./minimal-examples/ssproxy/ssproxy-socket`. + +## Options + +|Commandline option|Meaning| +|---|---| +|-d \|Enable logging levels (default 1031 (USER, ERR, WARN, NOTICE), 1039 = +INFO, 1151 = +INFO, DEBUG), `-DCMAKE_BUILD_TYPE=DEBUG` needed for logs more verbose that NOTICE +|--ssproxy-port \|If going via an SS Proxy, default is Unix Domain Socket @proxy.ss.lws, you can force a different proxy's TCP port with this| +|--ssproxy-ads \|Set non-default hostname or IP address proxy is on| +|--ssproxy-iface \|Set non-default UDS path if starts with +, else interface to bind TCP connection to for proxy| + diff --git a/minimal-examples/client/ws-echo/example-policy.json b/minimal-examples/client/ws-echo/example-policy.json new file mode 100644 index 000000000..fa8c5bc2b --- /dev/null +++ b/minimal-examples/client/ws-echo/example-policy.json @@ -0,0 +1,40 @@ +{ + "release": "1", + "product": "sx-http-post", + "schema-version": 1, + "retry": [{ + "default": { + "backoff": [1000, 2000, 3000, 5000, 10000], + "conceal": 5, + "jitterpc": 20, + "svalidping": 30, + "svalidhup": 35 + } + }], + "certs": [{ + "dst_root_x3": "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" + } + ], + "trust_stores": [{ + "name": "le_via_dst", + "stack": [ "dst_root_x3" ] + }], + "s": [ + { + "sx_ws_echo": { + "endpoint": "libwebsockets.org", + "port": 443, + "protocol": "ws", + "ws_subprotocol": "lws-mirror-protocol", + "http_url": "", + "tls": true, + "nailed_up": true, + "ws_binary": true, + "allow_redirects": true, + "retry": "default", + "tls_trust_store": "le_via_dst" + } + } + ] +} + diff --git a/minimal-examples/client/ws-echo/main.c b/minimal-examples/client/ws-echo/main.c new file mode 100644 index 000000000..2b5f95b79 --- /dev/null +++ b/minimal-examples/client/ws-echo/main.c @@ -0,0 +1,60 @@ +/* + * ws-echo example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates http post using the LWS high-level SS apis. + * + * - main.c: (this file) boilerplate to create the lws_context + * and event loop + * - ws-echo-ss.c: the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +/* b0: clr when peer ACKed request, b1: clr when recieved whole response */ +int test_result = 3; + +extern const lws_ss_info_t ssi_ws_echo_t; /* from hello_world-ss.c */ + +static struct lws_context *cx; /* so the SIGINT handler below can access it */ + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int +main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + + lws_context_info_defaults(&info, "example-policy.json"); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + lwsl_user("LWS SS ws-echo example [-d]\n"); + + if (!(cx = lws_create_context(&info))) { + lwsl_err("lws init failed\n"); + return 1; + } + + if (lws_ss_create(cx, 0, &ssi_ws_echo_t, NULL, NULL, NULL, NULL)) { + lwsl_cx_err(cx, "failed to create get secure stream"); + lws_context_destroy(cx); + return 1; + } + + lws_context_default_loop_run_destroy(cx); + + /* process ret 0 if actual is as expected (0, or--expected-exit 123) */ + + return lws_cmdline_passfail(argc, argv, test_result); +} diff --git a/minimal-examples/client/ws-echo/ws-echo-ss.c b/minimal-examples/client/ws-echo/ws-echo-ss.c new file mode 100644 index 000000000..85f241f0e --- /dev/null +++ b/minimal-examples/client/ws-echo/ws-echo-ss.c @@ -0,0 +1,134 @@ +/* + * SS ws-echo example + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Demonstrates http post using the LWS high-level SS apis. + * + * - main.c: boilerplate to create the lws_context and event loop + * - ws-echo-ss.c: (this file) the secure stream user code + * - example-policy.json: the example policy + */ + +#include +#include + +extern int test_result; + +LWS_SS_USER_TYPEDEF + lws_sorted_usec_list_t sul; + char msg[64]; + const char *payload; + size_t size; + size_t pos; + + int count; +} ws_echo_t; + +static lws_ss_state_return_t +ws_echo_tx(void *userobj, lws_ss_tx_ordinal_t ord, uint8_t *buf, size_t *len, + int *flags) +{ + ws_echo_t *g = (ws_echo_t *)userobj; + lws_ss_state_return_t r = LWSSSSRET_OK; + + if (g->size == g->pos) + return LWSSSSRET_TX_DONT_SEND; + + if (*len > g->size - g->pos) + *len = g->size - g->pos; + + if (!g->pos) + *flags |= LWSSS_FLAG_SOM; + + memcpy(buf, g->payload + g->pos, *len); + g->pos += *len; + + if (g->pos != g->size) + /* more to do */ + r = lws_ss_request_tx(lws_ss_from_user(g)); + else + *flags |= LWSSS_FLAG_EOM; + + lwsl_ss_user(lws_ss_from_user(g), "TX %zu, flags 0x%x, r %d", *len, + (unsigned int)*flags, (int)r); + + return r; +} + +static lws_ss_state_return_t +ws_echo_rx(void *userobj, const uint8_t *in, size_t len, int flags) +{ + ws_echo_t *g = (ws_echo_t *)userobj; + + lwsl_ss_user(lws_ss_from_user(g), "RX %zu, flags 0x%x", len, + (unsigned int)flags); + + lwsl_hexdump_notice(in, len); + + if ((flags & LWSSS_FLAG_EOM) == LWSSS_FLAG_EOM) + /* We received the whole response */ + test_result &= ~2; + + return LWSSSSRET_OK; +} + +static void +sul_cb(lws_sorted_usec_list_t *sul) +{ + ws_echo_t *g = (ws_echo_t *)lws_container_of(sul, ws_echo_t, sul); + + /* provide a hint about the payload size */ + g->pos = 0; + g->payload = g->msg; + g->size = (size_t)lws_snprintf(g->msg, sizeof(g->msg), + "hello %d", g->count++); + + if (lws_ss_request_tx_len(lws_ss_from_user(g), (unsigned long)g->size)) + lwsl_notice("%s: req failed\n", __func__); + + lws_sul_schedule(lws_ss_cx_from_user(g), 0, &g->sul, sul_cb, + LWS_US_PER_SEC / 2); +} + +static lws_ss_state_return_t +ws_echo_state(void *userobj, void *h_src, lws_ss_constate_t state, + lws_ss_tx_ordinal_t ack) +{ + ws_echo_t *g = (ws_echo_t *)userobj; + + switch ((int)state) { + case LWSSSCS_CREATING: + /* run for 5s then exit */ + lws_ss_start_timeout(lws_ss_from_user(g), 5000); + break; + + case LWSSSCS_CONNECTED: + test_result &= ~1; + lws_sul_schedule(lws_ss_cx_from_user(g), 0, &g->sul, sul_cb, + LWS_US_PER_SEC / 2); + break; + + case LWSSSCS_TIMEOUT: + /* for this test, when our 5s are up, we exit the process */ + lws_sul_cancel(&g->sul); + lws_default_loop_exit(lws_ss_cx_from_user(g)); + break; + + case LWSSSCS_DISCONNECTED: /* for our example, disconnect = done */ + lws_sul_cancel(&g->sul); + lws_default_loop_exit(lws_ss_cx_from_user(g)); + break; + } + + return LWSSSSRET_OK; +} + +LWS_SS_INFO("sx_ws_echo", ws_echo_t) + .tx = ws_echo_tx, + .rx = ws_echo_rx, + .state = ws_echo_state, +}; diff --git a/minimal-examples/embedded/pico/pico-sspc-binance/README.md b/minimal-examples/embedded/pico/pico-sspc-binance/README.md index 3a10cf716..fcfa51970 100644 --- a/minimal-examples/embedded/pico/pico-sspc-binance/README.md +++ b/minimal-examples/embedded/pico/pico-sspc-binance/README.md @@ -55,7 +55,7 @@ keep up. ## Build This builds as a toplevel project using the pcio sdk, it builds -lws via a symlink, and links with liblws-sspc.a rather than libwebsockets.a +lws via a symlink, and links with libwebsockets.a built with `-DLWS_ONLY_SSPC` Adapt `PICO_SDK_PATH` below to where your pico sdk is installed @@ -70,8 +70,9 @@ unmount it. ## Running -On the PC, you need to build lws-minimal-secure-streams-custom-proxy-transport, -which needs lws built with `LWS_WITHOUT_EXTENSIONS=0`. This connects to +On the PC, you need to build `lws-minimal-ssproxy-custom-transport-uart`, from +`./minimal-examples/ssproxy/ssproxy-custom-transport-uart`, +which needs lws built with `-DLWS_WITHOUT_EXTENSIONS=0`. This connects to `/dev/ttyUSB0` and starts the mux + SS Proxy. On the Pico, you can monitor the serial console over USB to see logs via diff --git a/minimal-examples/embedded/pico/pico-sspc-binance/binance-ss.c b/minimal-examples/embedded/pico/pico-sspc-binance/binance-ss.c index 688c9290b..065e60da7 100644 --- a/minimal-examples/embedded/pico/pico-sspc-binance/binance-ss.c +++ b/minimal-examples/embedded/pico/pico-sspc-binance/binance-ss.c @@ -28,10 +28,7 @@ typedef struct range { unsigned int samples; } range_t; -typedef struct binance { - struct lws_ss_handle *ss; - void *opaque_data; - +LWS_SS_USER_TYPEDEF uint64_t data_in; uint64_t data_in_last_sec; @@ -99,7 +96,8 @@ sul_hz_cb(lws_sorted_usec_list_t *sul) (unsigned long)((bin->e_lat_range.sum / bin->e_lat_range.samples) / 1000), bin->e_lat_range.samples, - (unsigned long)((bin->data_in - bin->data_in_last_sec) / 1024)); + (unsigned long)((bin->data_in - + bin->data_in_last_sec) / 1024)); range_reset(&bin->e_lat_range); range_reset(&bin->price_range); @@ -217,11 +215,7 @@ binance_state(void *userobj, void *h_src, lws_ss_constate_t state, return LWSSSSRET_OK; } -const lws_ss_info_t ssi_binance = { - .handle_offset = offsetof(binance_t, ss), - .opaque_user_data_offset = offsetof(binance_t, opaque_data), +LWS_SS_INFO("binance", binance_t) .rx = binance_rx, .state = binance_state, - .user_alloc = sizeof(binance_t), - .streamtype = "binance", /* bind to corresponding policy */ }; diff --git a/minimal-examples/embedded/pico/pico-sspc-binance/get-ss.c b/minimal-examples/embedded/pico/pico-sspc-binance/get-ss.c index fc0145121..1df4e823c 100644 --- a/minimal-examples/embedded/pico/pico-sspc-binance/get-ss.c +++ b/minimal-examples/embedded/pico/pico-sspc-binance/get-ss.c @@ -1,7 +1,7 @@ /* * pico-sspc-binance * - * Written in 2010-2021 by Andy Green + * Written in 2010 - 2021 by Andy Green * * This file is made available under the Creative Commons CC0 1.0 * Universal Public Domain Dedication. @@ -12,10 +12,7 @@ #include "private.h" -typedef struct { - struct lws_ss_handle *ss; - void *opaque_data; - +LWS_SS_USER_TYPEDEF lws_sorted_usec_list_t sul5; } get_t; @@ -24,9 +21,8 @@ sul_start_get(lws_sorted_usec_list_t *sul) { get_t *g = lws_container_of(sul, get_t, sul5); - lwsl_ss_notice(g->ss, "conn"); - lws_ss_request_tx(g->ss); - lws_sul_schedule(lws_ss_get_context(g->ss), 0, sul, sul_start_get, + lws_ss_request_tx(lws_ss_from_user(g)); + lws_sul_schedule(lws_ss_cx_from_user(g), 0, sul, sul_start_get, 5 * LWS_US_PER_SEC); } @@ -35,7 +31,7 @@ get_rx(void *userobj, const uint8_t *in, size_t len, int flags) { get_t *g = (get_t *)userobj; - lwsl_ss_notice(g->ss, "RX %u, flags 0x%x", + lwsl_ss_notice(lws_ss_from_user(g), "RX %u, flags 0x%x", (unsigned int)len, (unsigned int)flags); if (len) { @@ -53,18 +49,12 @@ get_state(void *userobj, void *h_src, lws_ss_constate_t state, { get_t *g = (get_t *)userobj; - lwsl_ss_notice(g->ss, "%s (%d), ord 0x%x", + lwsl_ss_notice(lws_ss_from_user(g), "%s (%d), ord 0x%x", lws_ss_state_name((int)state), state, (unsigned int)ack); switch (state) { case LWSSSCS_CREATING: - /* - * ... also let's start a sul that creates a second stream to - * GET from libwebsockets.org every 5s, showing we are running - * multiple SS on the transport successfully. - */ - - lws_sul_schedule(lws_ss_get_context(g->ss), 0, &g->sul5, + lws_sul_schedule(lws_ss_cx_from_user(g), 0, &g->sul5, sul_start_get, 5 * LWS_US_PER_SEC); break; case LWSSSCS_DESTROYING: @@ -75,11 +65,7 @@ get_state(void *userobj, void *h_src, lws_ss_constate_t state, return LWSSSSRET_OK; } -const lws_ss_info_t ssi_get = { - .handle_offset = offsetof(get_t, ss), - .opaque_user_data_offset = offsetof(get_t, opaque_data), +LWS_SS_INFO("mintest-lws", get_t) .rx = get_rx, .state = get_state, - .user_alloc = sizeof(get_t), - .streamtype = "mintest-lws", /* bind to this policy */ }; diff --git a/minimal-examples/embedded/pico/pico-sspc-binance/main.c b/minimal-examples/embedded/pico/pico-sspc-binance/main.c index b2e56da0d..864924a31 100644 --- a/minimal-examples/embedded/pico/pico-sspc-binance/main.c +++ b/minimal-examples/embedded/pico/pico-sspc-binance/main.c @@ -79,12 +79,12 @@ main(void) * mux -> transport -> proxy -> binance wss */ - if (lws_ss_create(&cx, 0, &ssi_binance, NULL, NULL, NULL, NULL)) { + if (lws_ss_create(&cx, 0, &ssi_binance_t, NULL, NULL, NULL, NULL)) { printf("failed to create binance secure stream\n"); return 1; } - if (lws_ss_create(&cx, 0, &ssi_get, NULL, NULL, NULL, NULL)) { + if (lws_ss_create(&cx, 0, &ssi_get_t, NULL, NULL, NULL, NULL)) { printf("failed to create get secure stream\n"); return 1; } diff --git a/minimal-examples/embedded/pico/pico-sspc-binance/private.h b/minimal-examples/embedded/pico/pico-sspc-binance/private.h index 11949b965..5d061d313 100644 --- a/minimal-examples/embedded/pico/pico-sspc-binance/private.h +++ b/minimal-examples/embedded/pico/pico-sspc-binance/private.h @@ -40,5 +40,5 @@ void serial_handle_events(lws_transport_mux_t *tm); /* our SS bindings */ -extern const lws_ss_info_t ssi_binance; /* binance-ss.c */ -extern const lws_ss_info_t ssi_get; /* get-ss.c */ +extern const lws_ss_info_t ssi_binance_t, /* binance-ss.c */ + ssi_get_t; /* get-ss.c */ diff --git a/minimal-examples/server/hello_world/CMakeLists.txt b/minimal-examples/server/hello_world/CMakeLists.txt new file mode 100644 index 000000000..1a8fada6d --- /dev/null +++ b/minimal-examples/server/hello_world/CMakeLists.txt @@ -0,0 +1,52 @@ +project(lws-minimal-ss-server-hello_world C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(SRCS main.c ss-server.c) + +set(requirements 1) +require_lws_config(LWS_ROLE_H1 1 requirements) +require_lws_config(LWS_WITH_SERVER 1 requirements) +require_lws_config(LWS_WITH_SYS_SMD 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY 0 requirements) + +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 has_ss_proxy) + +if (requirements) + add_executable(${PROJECT_NAME} ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + + if (HAS_LWS_WITH_SECURE_STREAMS_PROXY_API OR has_ss_proxy OR + LWS_WITH_SECURE_STREAMS_PROXY_API) + + add_compile_options(-DLWS_SS_USE_SSPC) + add_executable(${PROJECT_NAME}-client ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME}-client + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME}-client + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME}-client + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() + endif() +endif() diff --git a/minimal-examples/server/hello_world/README.md b/minimal-examples/server/hello_world/README.md new file mode 100644 index 000000000..6e98f1180 --- /dev/null +++ b/minimal-examples/server/hello_world/README.md @@ -0,0 +1,72 @@ +# lws minimal secure streams server + +The application sets up a tls + ws server on https://localhost:7681 + +It does it using Secure Streams... information about how the server should +operate is held in JSON policy in main.c + +Visiting the server in a modern browser will fetch some html + JS, the JS will +create a ws link back to the server and the server will spam an incrementing +number that is displayed in the browser every 100ms. + +The app also has a SS client that works, but it's disabled by default since +we're interested in server. + +## build + +``` + $ cmake . && make +``` + +## usage + +Commandline option|Meaning +---|--- +-d |Debug verbosity in decimal, eg, -d15 + +``` +[2020/07/27 10:51:04:8994] U: LWS Secure Streams Server +[2020/07/27 10:51:04:9440] N: LWS: 4.0.99-v4.0.0-245-ge6eb4417a, loglevel 1031 +[2020/07/27 10:51:04:9444] N: NET CLI SRV H1 H2 WS MQTT SS-JSON-POL SSPROX ASYNC_DNS IPv6-absent +[2020/07/27 10:51:05:1685] N: lws_adopt_descriptor_vhost2: wsi 0x5317d30, vhost system ss_handle (nil) +[2020/07/27 10:51:05:1753] N: lws_adopt_descriptor_vhost2: wsi 0x53182c0, vhost system ss_handle (nil) +[2020/07/27 10:51:05:2129] N: lws_ss_policy_parser_cb: server 'self_localhost' keep 52 0x5318cc0 +[2020/07/27 10:51:05:2134] N: lws_ss_policy_parser_cb: server 'self_localhost_key' keep 53 0x5318cf8 +[2020/07/27 10:51:05:2192] N: lws_ss_policy_ref_trust_store: le_via_isrg trust store initial 'isrg_root_x1' +[2020/07/27 10:51:05:7804] N: smd_cb: creating server stream +[2020/07/27 10:51:05:7851] N: Vhost 'myserver' using TLS mode +[2020/07/27 10:51:05:8660] N: SSL ECDH curve 'prime256v1' +[2020/07/27 10:51:06:1035] N: vhost myserver: cert expiry: 729599d +[2020/07/27 10:51:06:1039] N: lws_ss_create: created server myserver +[2020/07/27 10:51:11:8650] N: lws_adopt_descriptor_vhost2: wsi 0x5b046e0, vhost myserver ss_handle 0x56e2be0 +[2020/07/27 10:51:11:8672] U: myss_srv_state: 0x5b52f60 LWSSSCS_CREATING, ord 0x0 +[2020/07/27 10:51:11:8693] U: myss_srv_state: 0x5b52f60 LWSSSCS_CONNECTING, ord 0x0 +[2020/07/27 10:51:11:8696] U: myss_srv_state: 0x5b52f60 LWSSSCS_CONNECTED, ord 0x0 +[2020/07/27 10:51:11:9743] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_CREATING, ord 0x0 +[2020/07/27 10:51:11:9747] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_CONNECTING, ord 0x0 +[2020/07/27 10:51:11:9747] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_CONNECTED, ord 0x0 +[2020/07/27 10:51:12:0192] U: myss_srv_state: 0x5bad0a0 LWSSSCS_CREATING, ord 0x0 +[2020/07/27 10:51:12:0193] U: myss_srv_state: 0x5bad0a0 LWSSSCS_CONNECTING, ord 0x0 +[2020/07/27 10:51:12:0194] U: myss_srv_state: 0x5bad0a0 LWSSSCS_CONNECTED, ord 0x0 +[2020/07/27 10:51:12:0306] N: secstream_h1: LWS_CALLBACK_HTTP +[2020/07/27 10:51:12:0329] U: myss_srv_state: 0x5bad0a0 LWSSSCS_SERVER_TXN, ord 0x0 +[2020/07/27 10:51:12:0481] N: lws_h2_ws_handshake: Server SS 0x5ba2bd0 .wsi 0x5ba27b0 switching to ws protocol +[2020/07/27 10:51:12:0484] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_SERVER_UPGRADE, ord 0x0 +[2020/07/27 10:51:12:0541] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_CONNECTED, ord 0x0 +[2020/07/27 10:51:12:1222] U: myss_srv_state: 0x5bd1100 LWSSSCS_CREATING, ord 0x0 +[2020/07/27 10:51:12:1222] U: myss_srv_state: 0x5bd1100 LWSSSCS_CONNECTING, ord 0x0 +[2020/07/27 10:51:12:1223] U: myss_srv_state: 0x5bd1100 LWSSSCS_CONNECTED, ord 0x0 +[2020/07/27 10:51:12:1242] N: lws_h2_ws_handshake: Server SS 0x5bd1100 .wsi 0x5bd0ce0 switching to ws protocol +[2020/07/27 10:51:12:1243] U: myss_srv_state: 0x5bd1100 LWSSSCS_SERVER_UPGRADE, ord 0x0 +[2020/07/27 10:51:12:1246] U: myss_srv_state: 0x5bd1100 LWSSSCS_CONNECTED, ord 0x0 +^C[2020/07/27 10:51:15:2809] U: myss_srv_state: 0x5bad0a0 LWSSSCS_DISCONNECTED, ord 0x0 +[2020/07/27 10:51:15:2838] U: myss_srv_state: 0x5bad0a0 LWSSSCS_DESTROYING, ord 0x0 +[2020/07/27 10:51:15:2938] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_DISCONNECTED, ord 0x0 +[2020/07/27 10:51:15:2946] U: myss_srv_state: 0x5ba2bd0 LWSSSCS_DESTROYING, ord 0x0 +[2020/07/27 10:51:15:2952] U: myss_srv_state: 0x5bd1100 LWSSSCS_DISCONNECTED, ord 0x0 +[2020/07/27 10:51:15:2953] U: myss_srv_state: 0x5bd1100 LWSSSCS_DESTROYING, ord 0x0 +[2020/07/27 10:51:15:2960] U: myss_srv_state: 0x5b52f60 LWSSSCS_DISCONNECTED, ord 0x0 +[2020/07/27 10:51:15:2961] U: myss_srv_state: 0x5b52f60 LWSSSCS_DESTROYING, ord 0x0 +[2020/07/27 10:51:15:3042] U: myss_srv_state: 0x56e2be0 LWSSSCS_DESTROYING, ord 0x0 +[2020/07/27 10:51:15:3378] U: Completed: OK +``` diff --git a/minimal-examples/server/hello_world/example-policy.json b/minimal-examples/server/hello_world/example-policy.json new file mode 100644 index 000000000..ae626a02c --- /dev/null +++ b/minimal-examples/server/hello_world/example-policy.json @@ -0,0 +1,33 @@ +{ + "release":"01234567", + "product":"myproduct", + "schema-version":1, + "retry": [{"default": {"backoff": [1000,2000,3000,5000,10000],"conceal":5,"jitterpc":20,"svalidping":300,"svalidhup":310}}], + "certs": [{ + "dst_root_x3": "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" + },{ + "self_localhost": "MIIF5jCCA86gAwIBAgIJANq50IuwPFKgMA0GCSqGSIb3DQEBCwUAMIGGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRXJld2hvbjETMBEGA1UEBwwKQWxsIGFyb3VuZDEbMBkGA1UECgwSbGlid2Vic29ja2V0cy10ZXN0MRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEG5vbmVAaW52YWxpZC5vcmcwIBcNMTgwMzIwMDQxNjA3WhgPMjExODAyMjQwNDE2MDdaMIGGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRXJld2hvbjETMBEGA1UEBwwKQWxsIGFyb3VuZDEbMBkGA1UECgwSbGlid2Vic29ja2V0cy10ZXN0MRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEG5vbmVAaW52YWxpZC5vcmcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCjYtuWaICCY0tJPubxpIgIL+WWmz/fmK8IQr11Wtee6/IUyUlo5I602mq1qcLhT/kmpoR8Di3DAmHKnSWdPWtn1BtXLErLlUiHgZDrZWInmEBjKM1DZf+CvNGZ+EzPgBv5nTekLWcfI5ZZtoGuIP1Dl/IkNDw8zFz4cpiMe/BFGemyxdHhLrKHSm8Eo+nT734tItnHKT/m6DSU0xlZ13d6ehLRm7/+Nx47M3XMTRH5qKP/7TTE2s0U6+M0tsGI2zpRi+m6jzhNyMBTJ1u58qAe3ZW5/+YAiuZYAB6n5bhUp4oFuB5wYbcBywVR8ujInpF8buWQUjy5N8pSNp7szdYsnLJpvAd0sibrNPjC0FQCNrpNjgJmIK3+mKk4kXX7ZTwefoAzTK4l2pHNuC53QVc/EF++GBLAxmvCDq9ZpMIYi7OmzkkAKKC9Ue6Ef217LFQCFIBKIzv9cgi9fwPMLhrKleoVRNsecBsCP569WgJXhUnwf2lon4fEZr3+vRuc9shfqnV0nPN1IMSnzXCast7I2fiuRXdIz96KjlGQpP4XfNVA+RGL7aMnWOFIaVrKWLzAtgzoGMTvP/AuehKXncBJhYtW0ltTioVx+5yTYSAZWl+IssmXjefxJqYi2/7QWmv1QC9psNcjTMaBQLN03T1Qelbs7Y27sxdEnNUth4kI+wIDAQABo1MwUTAdBgNVHQ4EFgQU9mYU23tW2zsomkKTAXarjr2vjuswHwYDVR0jBBgwFoAU9mYU23tW2zsomkKTAXarjr2vjuswDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEANjIBMrowYNCbhAJdP7dhlhT2RUFRdeRUJD0IxrH/hkvb6myHHnK8nOYezFPjUlmRKUgNEDuAxbnXZzPdCRNV9V2mShbXvCyiDY7WCQE2Bn44z26O0uWVk+7DNNLH9BnkwUtOnM9PwtmD9phWexm4q2GnTsiL6Ul6cy0QlTJWKVLEUQQ6yda582e23J1AXqtqFcpfoE34H3afEiGy882b+ZBiwkeV+oq6XVF8sFyr9zYrv9CvWTYlkpTQfLTZSsgPdEHYVcjvxQ2D+XyDR0aRLRlvxUa9dHGFHLICG34Juq5Ai6lM1EsoD8HSsJpMcmrH7MWw2cKkujC3rMdFTtte83wF1uuF4FjUC72+SmcQN7A386BC/nk2TTsJawTDzqwOu/VdZv2g1WpTHlumlClZeP+G/jkSyDwqNnTu1aodDmUa4xZodfhP1HWPwUKFcq8oQr148QYAAOlbUOJQU7QwRWd1VbnwhDtQWXC92A2w1n/xkZSR1BM/NUSDhkBSUU1WjMbWg6GgmnIZLRerQCu1Oozr87rOQqQakPkyt8BUSNK3K42j2qcfhAONdRl8Hq8Qs5pupy+s8sdCGDlwR3JNCMv6u48OK87F4mcIxhkSefFJUFII25pCGN5WtE4p5l+9cnO1GrIXe2Hl/7M0c/lbZ4FvXgARlex2rkgS0Ka06HE=" + },{ + "self_localhost_key": "MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCjYtuWaICCY0tJPubxpIgIL+WWmz/fmK8IQr11Wtee6/IUyUlo5I602mq1qcLhT/kmpoR8Di3DAmHKnSWdPWtn1BtXLErLlUiHgZDrZWInmEBjKM1DZf+CvNGZ+EzPgBv5nTekLWcfI5ZZtoGuIP1Dl/IkNDw8zFz4cpiMe/BFGemyxdHhLrKHSm8Eo+nT734tItnHKT/m6DSU0xlZ13d6ehLRm7/+Nx47M3XMTRH5qKP/7TTE2s0U6+M0tsGI2zpRi+m6jzhNyMBTJ1u58qAe3ZW5/+YAiuZYAB6n5bhUp4oFuB5wYbcBywVR8ujInpF8buWQUjy5N8pSNp7szdYsnLJpvAd0sibrNPjC0FQCNrpNjgJmIK3+mKk4kXX7ZTwefoAzTK4l2pHNuC53QVc/EF++GBLAxmvCDq9ZpMIYi7OmzkkAKKC9Ue6Ef217LFQCFIBKIzv9cgi9fwPMLhrKleoVRNsecBsCP569WgJXhUnwf2lon4fEZr3+vRuc9shfqnV0nPN1IMSnzXCast7I2fiuRXdIz96KjlGQpP4XfNVA+RGL7aMnWOFIaVrKWLzAtgzoGMTvP/AuehKXncBJhYtW0ltTioVx+5yTYSAZWl+IssmXjefxJqYi2/7QWmv1QC9psNcjTMaBQLN03T1Qelbs7Y27sxdEnNUth4kI+wIDAQABAoICAFWe8MQZb37k2gdAV3Y6aq8fqokKQqbCNLd3giGFwYkezHXoJfg6Di7oZxNcKyw35LFEghkgtQqErQqo35VPIoH+vXUpWOjnCmM4muFA9/cX6mYMc8TmJsg0ewLdBCOZVw+wPABlaqz+0UOiSMMftpk9fz9JwGd8ERyBsT+tk3Qi6D0vPZVsC1KqxxL/cwIFd3Hf2ZBtJXe0KBn1pktWht5AKqx9mld2Ovl7NjgiC1Fx9r+fZw/iOabFFwQA4dr+R8mEMK/7bd4VXfQ1o/QGGbMTG+ulFrsiDyP+rBIAaGC0i7gDjLAIBQeDhP409ZhswIEc/GBtODU372a2CQK/u4Q/HBQvuBtKFNkGUooLgCCbFxzgNUGc83GB/6IwbEM7R5uXqsFiE71LpmroDyjKTlQ8YZkpIcLNVLw0usoGYHFm2rvCyEVlfsE3Ub8cFyTFk50SeOcF2QL2xzKmmbZEpXglxBHR0hjgon0IKJDGfor4bHO7Nt+1Ece8u2oTEKvpz5aIn44OeC5mApRGy83/0bvsesnWjDE/bGpoT8qFuy+0urDEPNId44XcJm1IRIlG56ErxC3l0s11wrIpTmXXckqwzFR9s2z7f0zjeyxqZg4NTPI7wkM3M8BXlvp2GTBIeoxrWB4V3YArwu8QF80QBgVzmgHl24nTg00UH1OjZsABAoIBAQDOxftSDbSqGytcWqPYP3SZHAWDA0O4ACEM+eCwau9ASutl0IDlNDMJ8nC2ph25BMe5hHDWp2cGQJog7pZ/3qQogQho2gUniKDifN7740QdykllTzTVROqmP8+efreIvqlzHmuqaGfGs5oTkZaWj5su+B+bT+9rIwZcwfs5YRINhQRx17qa++xh5mfE25c+M9fiIBTiNSo4lTxWMBShnK8xrGaMEmN7W0qTMbFHPgQz5FcxRjCCqwHilwNBeLDTp/ZECEB7y34khVh531mBE2mNzSVIQcGZP1I/DvXjW7UUNdgFwii/GW+6M0uUDy23UVQpbFzcV8o1C2nZc4Fb4zwBAoIBAQDKSJkFwwuRnaVJS6WxOKjX8MCu9/cKPnwBv2mmI2jgGxHTw5sr3ahmF5eTb8Zo19BowytN+tr62ZFoIBA9Ubc9esEAU8l3fggdfM82cuR9sGcfQVoCh8tMg6BP8IBLOmbSUhN3PG2m39I802u0fFNVQCJKhx1m1MFFLOu7lVcDS9JN+oYVPb6MDfBLm5jOiPuYkFZ4gH79J7gXI0/YKhaJ7yXthYVkdrSF6Eooer4RZgma62Dd1VNzSq3JBo6rYjF7Lvd+RwDCR1thHrmf/IXplxpNVkoMVxtzbrrbgnC25QmvRYc0rlS/kvM4yQhMH3eA7IycDZMpY+0xm7I7jTT7AoIBAGKzKIMDXdCxBWKhNYJ8z7hiItNl1IZZMW2TPUiY0rl6yaChBVXjM9W0r07QPnHZsUiByqb743adkbTUjmxdJzjaVtxN7ZXwZvOVrY7I7fPWYnCEfXCr4+IVpZI/ZHZWpGX6CGSgT6EOjCZ5IUufIvEpqVSmtF8MqfXO9o9uIYLokrWQx1dBl5UnuTLDqw8bChq7O5y6yfuWaOWvL7nxI8NvSsfj4y635gIa/0dFeBYZEfHIUlGdNVomwXwYEzgE/c19ruIowX7HU/NgxMWTMZhpazlxgesXybel+YNcfDQ4e3RMOMz3ZFiaMaJsGGNf4++d9TmMgk4Ns6oDs6Tb9AECggEBAJYzd+SOYo26iBu3nw3L65uEeh6xou8pXH0Tu4gQrPQTRZZ/nT3iNgOwqu1gRuxcq7TOjt41UdqIKO8vN7/AaJavCpaKoIMowy/aGCbvAvjNPpU3unU8jdl/t08EXs79S5IKPcgAx87sTTi7KDN5SYt4tr2uPEe53NTXuSatilG5QCyExIELOuzWAMKzg7CAiIlNS9foWeLyVkBgCQ6Sme/L8ta+mUDy37K6vC34jh9vK9yrwF6X44ItRoOJafCaVfGI+175q/eWcqTX4q+IG4tKls4sL4mgOJLq+ra50aYMxbcuommctPMXU6CrrYyQpPTHMNVDQy2ttFdsq9iKTncCggEBAMmt/8yvPflS+xv3kg/ZBvR9JB1In2n3rUCYYD47ReKFqJ03Vmq5C9nY56s9w7OUO8perBXlJYmKZQhO4293lvxZD2Iq4NcZbVSCMoHAUzhzY3brdgtSIxa2gGveGAezZ38qKIU26dkz7deECY4vrsRkwhpTW0LGVCpjcQoaKvymAoCmAs8V2oMrZiw1YQ9uOUoWwOqm1wZqmVcOXvPIS2gWAs3fQlWjH9hkcQTMsUaXQDOD0aqkSY3ENqOvbCV1/oUpRi3076khCoAXI1bKSn/AvR3KDP14B5toHI/F5OTSEiGhhHesgRrsfBrpEY1IATtPq1taBZZogRqI3rOkkPk=" + } +], + "trust_stores": [ + {"name": "le_via_dst", + "stack": ["dst_root_x3"]} + ],"s": [ { + "myserver": { + "server":true, + "port":7681, + "protocol":"h2", + "metadata": [ + {"mime": "Content-Type:", + "method": "","path": ""} + ], + "tls":true, + "server_cert":"self_localhost", + "server_key":"self_localhost_key" + } + } + ] +} + diff --git a/minimal-examples/server/hello_world/main.c b/minimal-examples/server/hello_world/main.c new file mode 100644 index 000000000..3f74d41bb --- /dev/null +++ b/minimal-examples/server/hello_world/main.c @@ -0,0 +1,65 @@ +/* + * lws-minimal-secure-streams-server + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Simplest possible SS https server + */ + +#include +#include + +extern const lws_ss_info_t ssi_myss_srv_t; + +static struct lws_context *cx; +int test_result = 0, multipart; + +static int +smd_cb(void *opaque, lws_smd_class_t c, lws_usec_t ts, void *buf, size_t len) +{ + if (!(c & LWSSMDCL_SYSTEM_STATE) || + lws_json_simple_strcmp(buf, len, "\"state\":", "OPERATIONAL") || + !lws_ss_create(cx, 0, &ssi_myss_srv_t, NULL, NULL, NULL, NULL)) + return 0; + + lwsl_err("%s: failed to create secure stream\n", __func__); + lws_default_loop_exit(cx); + + return -1; +} + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int +main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + + lws_context_info_defaults(&info, "example-policy.json"); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + lwsl_user("LWS Secure Streams Server\n"); + + info.early_smd_cb = smd_cb; + info.early_smd_class_filter = LWSSMDCL_SYSTEM_STATE; + + cx = lws_create_context(&info); + if (!cx) { + lwsl_err("lws init failed\n"); + return 1; + } + + lws_context_default_loop_run_destroy(cx); + + /* process ret 0 if actual is as expected (0, or--expected-exit 123) */ + + return lws_cmdline_passfail(argc, argv, test_result); +} diff --git a/minimal-examples/server/hello_world/ss-server.c b/minimal-examples/server/hello_world/ss-server.c new file mode 100644 index 000000000..445ccf215 --- /dev/null +++ b/minimal-examples/server/hello_world/ss-server.c @@ -0,0 +1,87 @@ +/* + * lws-minimal-ss-server-hello_world + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * Simple SS server that just serves one thing. + */ + +#include + +LWS_SS_USER_TYPEDEF + char payload[200]; + size_t size; + size_t pos; +} myss_srv_t; + +static lws_ss_state_return_t +myss_srv_tx(void *userobj, lws_ss_tx_ordinal_t ord, uint8_t *buf, size_t *len, + int *flags) +{ + myss_srv_t *g = (myss_srv_t *)userobj; + lws_ss_state_return_t r = LWSSSSRET_OK; + + if (g->size == g->pos) + return LWSSSSRET_TX_DONT_SEND; + + if (*len > g->size - g->pos) + *len = g->size - g->pos; + + if (!g->pos) + *flags |= LWSSS_FLAG_SOM; + + memcpy(buf, g->payload + g->pos, *len); + g->pos += *len; + + if (g->pos != g->size) /* more to do */ + r = lws_ss_request_tx(lws_ss_from_user(g)); + else + *flags |= LWSSS_FLAG_EOM; + + lwsl_ss_user(lws_ss_from_user(g), "TX %zu, flags 0x%x, r %d", *len, + (unsigned int)*flags, (int)r); + + return r; +} + +static lws_ss_state_return_t +myss_srv_state(void *userobj, void *sh, lws_ss_constate_t state, + lws_ss_tx_ordinal_t ack) +{ + myss_srv_t *g = (myss_srv_t *)userobj; + + switch ((int)state) { + case LWSSSCS_CREATING: + return lws_ss_request_tx(lws_ss_from_user(g)); + + case LWSSSCS_SERVER_TXN: + /* + * A transaction is starting on an accepted connection. Say + * that we're OK with the transaction, prepare the user + * object with the response, and request tx to start sending it. + */ + lws_ss_server_ack(lws_ss_from_user(g), 0); + + if (lws_ss_set_metadata(lws_ss_from_user(g), "mime", + "text/html", 9)) + return LWSSSSRET_DISCONNECT_ME; + + g->size = (size_t)lws_snprintf(g->payload, sizeof(g->payload), + "Hello World: %lu", + (unsigned long)lws_now_usecs()); + g->pos = 0; + + return lws_ss_request_tx_len(lws_ss_from_user(g), + (unsigned long)g->size); + } + + return LWSSSSRET_OK; +} + +LWS_SS_INFO("myserver", myss_srv_t) + .tx = myss_srv_tx, + .state = myss_srv_state, +}; diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/CMakeLists.txt b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/CMakeLists.txt similarity index 69% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/CMakeLists.txt rename to minimal-examples/ssproxy/ssproxy-custom-transport-uart/CMakeLists.txt index c38f4bd3f..4f9db511f 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/CMakeLists.txt +++ b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/CMakeLists.txt @@ -1,11 +1,10 @@ -project(lws-minimal-secure-streams-custom-proxy-transport C) +project(lws-minimal-ssproxy-custom-transport-uart C) cmake_minimum_required(VERSION 2.8.12) find_package(libwebsockets CONFIG REQUIRED) list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) include(CheckCSourceCompiles) include(LwsCheckRequirements) -set(SAMP lws-minimal-secure-streams-custom-proxy-transport) set(SRCS main.c transport-serial.c) set(requirements 1) @@ -19,12 +18,17 @@ require_lws_config(LWS_WITH_SYS_STATE 1 requirements) # non-linux don't have B2000000 2Mbps USB serial baud rate constants if (requirements AND ${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - add_executable(${SAMP} ${SRCS}) + add_executable(${PROJECT_NAME} ${SRCS}) if (websockets_shared) - target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) - add_dependencies(${SAMP} websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) else() - target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) endif() endif() diff --git a/minimal-examples/ssproxy/ssproxy-custom-transport-uart/README.md b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/README.md new file mode 100644 index 000000000..29d713f49 --- /dev/null +++ b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/README.md @@ -0,0 +1,158 @@ +# lws minimal ssproxy UART transport + +Operates as a secure streams proxy, with a custom transport +for a UART + +See ./minimal-examples/embedded/pico/pico-sspc-binance for an RPi pico +based device that wants to use the proxy over UART. + +## build + +``` + $ cmake . && make +``` + +## usage + +Commandline option|Meaning +---|--- +-d |Debug verbosity in decimal, eg, -d15 +-f| Force connecting to the wrong endpoint to check backoff retry flow +-p |If not given, proxy listens on a Unix Domain Socket, if given listen on specified tcp port +-i |Optionally specify the UDS path (no -p) or network interface to bind to (if -p also given) + +``` +[2021/10/04 11:05:55:8347] U: LWS secure streams Proxy [-d] +[2021/10/04 11:05:55:8348] N: LWS: 4.2.99-v4.2.0-215-g0e30e05c8a, NET CLI SRV H1 H2 WS MQTT SS-JSON-POL SSPROX MbedTLS ConMon IPv6-absent +[2021/10/04 11:05:55:8350] N: ++ [1316112|wsi|0|pipe] (1) +[2021/10/04 11:05:55:8350] N: ++ [1316112|vh|0|netlink] (1) +[2021/10/04 11:05:55:8351] N: ++ [1316112|vh|1|default||-1] (2) +[2021/10/04 11:05:55:8354] N: ++ [1316112|vh|2|le_via_isrg||-1] (3) +[2021/10/04 11:05:55:8355] N: ++ [1316112|vh|3|_ss_default||-1] (4) +[2021/10/04 11:05:55:8355] U: cb_proxy_serial_transport: PROTOCOL_INIT default +[2021/10/04 11:05:55:8356] N: ++ [1316112|wsiSScli|0|captive_portal_detect] (1) +[2021/10/04 11:05:55:8356] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: (unset) -> LWSSSCS_CREATING +[2021/10/04 11:05:55:8356] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_CREATING -> LWSSSCS_POLL +[2021/10/04 11:05:55:8356] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_POLL -> LWSSSCS_CONNECTING +[2021/10/04 11:05:55:8356] N: ++ [1316112|wsicli|0|GET/h1/connectivitycheck.android.com/([1316112|wsiSScli|0|captive_portal_det] (1) +[2021/10/04 11:05:55:8452] N: lws_ss_sys_cpd: CPD already ongoing +[2021/10/04 11:05:55:9454] N: ++ [1316112|wsiSScli|1|fetch_policy] (2) +[2021/10/04 11:05:55:9454] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: (unset) -> LWSSSCS_CREATING +[2021/10/04 11:05:55:9455] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_CREATING -> LWSSSCS_POLL +[2021/10/04 11:05:55:9455] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_POLL -> LWSSSCS_CONNECTING +[2021/10/04 11:05:55:9455] N: ++ [1316112|wsicli|1|GET/h1/warmcat.com/([1316112|wsiSScli|1|fetch_policy])] (2) +[2021/10/04 11:05:56:0537] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTING -> LWSSSCS_CONNECTED +[2021/10/04 11:05:56:0538] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTED -> LWSSSCS_QOS_ACK_REMOTE +[2021/10/04 11:05:56:0538] N: lws_system_cpd_set: setting CPD result OK +[2021/10/04 11:05:56:0538] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_QOS_ACK_REMOTE -> LWSSSCS_DISCONNECTED +[2021/10/04 11:05:56:0538] N: [1316112|wsiSScli|0|captive_portal_detect]: lws_ss_check_next_state_ss: LWSSSCS_DISCONNECTED -> LWSSSCS_DESTROYING +[2021/10/04 11:05:56:0538] N: -- [1316112|wsiSScli|0|captive_portal_detect] (1) 218.222ms +[2021/10/04 11:05:56:0539] N: -- [1316112|wsicli|0|GET/h1/connectivitycheck.android.com/([1316112|wsiSScli|0|captive_portal_det] (1) 218.250ms +[2021/10/04 11:05:56:1210] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTING -> LWSSSCS_CONNECTED +[2021/10/04 11:05:56:1546] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTED -> LWSSSCS_QOS_ACK_REMOTE +[2021/10/04 11:05:56:1546] W: lws_ss_destroy: conn->ss->wsi 0 0 +[2021/10/04 11:05:56:1547] N: -- [1316112|wsicli|1|GET/h1/warmcat.com/([1316112|wsiSScli|1|fetch_policy])] (0) 209.245ms +[2021/10/04 11:05:56:1548] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_QOS_ACK_REMOTE -> LWSSSCS_DISCONNECTED +[2021/10/04 11:05:56:1548] N: [1316112|wsiSScli|1|fetch_policy]: lws_ss_check_next_state_ss: LWSSSCS_DISCONNECTED -> LWSSSCS_DESTROYING +[2021/10/04 11:05:56:1548] N: -- [1316112|wsiSScli|1|fetch_policy] (0) 209.356ms +[2021/10/04 11:05:56:1548] N: -- [1316112|vh|2|le_via_isrg||-1] (3) 319.414ms +[2021/10/04 11:05:56:1548] N: ++ [1316112|vh|4|s3-root-cert||-1] (4) +[2021/10/04 11:05:56:1548] N: ++ [1316112|vh|5|digicert||-1] (5) +[2021/10/04 11:05:56:1549] N: ++ [1316112|vh|6|le_via_isrg||-1] (6) +[2021/10/04 11:05:56:1549] N: ++ [1316112|vh|7|arca1||-1] (7) +[2021/10/04 11:05:56:1549] N: ++ [1316112|vh|8|mqtt_amz_iot||-1] (8) +[2021/10/04 11:05:56:1549] N: ++ [1316112|vh|9|avs_via_starfield||-1] (9) +[2021/10/04 11:05:56:1550] N: ++ [1316112|vh|a|api_amazon_com||-1] (10) +[2021/10/04 11:05:56:1550] U: lws_transport_mux_init_proxy_server: priv_inward (nil) +[2021/10/04 11:05:56:2099] N: open_serial_port: serial port opened 6 +[2021/10/04 11:05:56:2099] U: txp_serial_init_proxy_server: txp_priv_inward 0x1c70080 +[2021/10/04 11:05:56:2099] N: ++ [1316112|wsisrv|0|adopted] (1) +[2021/10/04 11:05:56:2099] N: LWS_CALLBACK_RAW_ADOPT_FILE +[2021/10/04 11:05:56:2099] U: txp_serial_init_proxy_server: OK (txp_priv_in 0x1c70080) +[2021/10/04 11:05:56:2099] U: lws_transport_mux_init_proxy_server: OK +[2021/10/04 11:05:56:2099] N: sul_ping_cb: issuing ping +[2021/10/04 11:05:56:2241] N: +[2021/10/04 11:05:56:2242] N: 0000: F9 F6 00 00 00 00 1F 2F 89 9C F7 00 00 01 27 29 ......./......') +[2021/10/04 11:05:56:2242] N: 0010: 4E A2 7B 00 00 00 00 1F 2F 8A 71 N.{...../.q +[2021/10/04 11:05:56:2242] N: +[2021/10/04 11:05:56:2242] U: lws_transport_mux_rx_parse: got PING +[2021/10/04 11:05:56:2242] U: lws_transport_mux_rx_parse: got PONG +[2021/10/04 11:05:56:2242] U: lws_transport_set_link: ******* transport mux link is UP +[2021/10/04 11:05:56:2400] N: +[2021/10/04 11:05:56:2400] N: 0000: F8 00 00 00 00 1F 2F C1 12 ....../.. +[2021/10/04 11:05:56:2400] N: +[2021/10/04 11:05:56:2400] U: lws_transport_mux_rx_parse: got PONGACK: ustime 523223314 +[2021/10/04 11:05:56:7500] N: +[2021/10/04 11:05:56:7500] N: 0000: F0 FF F0 FE .... +[2021/10/04 11:05:56:7501] N: +[2021/10/04 11:05:56:7501] N: ltm_ch_opens +[2021/10/04 11:05:56:7501] N: ltm_ch_opens +[2021/10/04 11:05:56:7659] N: +[2021/10/04 11:05:56:7659] N: 0000: F5 FF 00 13 AA 00 10 01 FF FF FF FF 1D 64 29 1F .............d). +[2021/10/04 11:05:56:7659] N: 0010: 62 69 6E 61 6E 63 65 F5 FE 00 17 AA 00 14 01 FF binance......... +[2021/10/04 11:05:56:7659] N: 0020: FF FF FF 1D C8 CA BB 6D 69 6E 74 65 73 74 2D 6C .......mintest-l +[2021/10/04 11:05:56:7659] N: 0030: 77 73 ws +[2021/10/04 11:05:56:7659] N: +[2021/10/04 11:05:56:7659] N: ltm_ch_payload +[2021/10/04 11:05:56:7659] N: lws_transport_path_proxy_dump: ltm_ch_payload: MUX: 0x1c70080, IN: ops txp_inside_proxy, priv (nil), ONW: ops txp_inside_proxy, priv (nil) +[2021/10/04 11:05:56:7659] N: ++ [1316112|wsiSScli|2|binance|v1|4294967295] (1) +[2021/10/04 11:05:56:7659] N: [1316112|wsiSScli|2|binance|v1|4294967295]: lws_ss_check_next_state_ss: (unset) -> LWSSSCS_CREATING +[2021/10/04 11:05:56:7659] N: lws_sss_proxy_onward_state: [1316112|wsiSScli|2|binance|v1|4294967295]: initializing dsh max len 262144 +[2021/10/04 11:05:56:7659] N: [1316112|wsiSScli|2|binance|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_CREATING -> LWSSSCS_CONNECTING +[2021/10/04 11:05:56:7659] N: ++ [1316112|wsicli|2|WS/h1/fstream.binance.com/([1316112|wsiSScli|2|binance|v1|4294967295])] (1) +[2021/10/04 11:05:56:7675] N: ltm_ch_payload +[2021/10/04 11:05:56:7675] N: lws_transport_path_proxy_dump: ltm_ch_payload: MUX: 0x1c70080, IN: ops txp_inside_proxy, priv (nil), ONW: ops txp_inside_proxy, priv (nil) +[2021/10/04 11:05:56:7675] N: ++ [1316112|wsiSScli|3|mintest-lws|v1|4294967295] (2) +[2021/10/04 11:05:56:7675] N: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: lws_ss_check_next_state_ss: (unset) -> LWSSSCS_CREATING +[2021/10/04 11:05:56:7675] N: lws_sss_proxy_onward_state: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: initializing dsh max len 32768 +[2021/10/04 11:05:56:7818] N: +[2021/10/04 11:05:56:7818] N: 0000: F5 FF 00 03 AB 00 00 ....... +[2021/10/04 11:05:56:7818] N: +[2021/10/04 11:05:56:7818] N: ltm_ch_payload +[2021/10/04 11:05:56:7818] N: lws_transport_path_proxy_dump: ltm_ch_payload: MUX: 0x1c70080, IN: ops txp_inside_proxy, priv (nil), ONW: ops txp_inside_proxy, priv (nil) +[2021/10/04 11:05:56:7818] N: lws_ss_proxy_deserialize_parse: ONWARD_CONNECT +[2021/10/04 11:05:57:8864] N: [1316112|wsiSScli|2|binance|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTING -> LWSSSCS_CONNECTED +[2021/10/04 11:05:57:8980] N: +[2021/10/04 11:05:57:8981] N: 0000: F5 FE 00 03 AB 00 00 ....... +[2021/10/04 11:05:57:8981] N: +[2021/10/04 11:05:57:8981] N: ltm_ch_payload +[2021/10/04 11:05:57:8981] N: lws_transport_path_proxy_dump: ltm_ch_payload: MUX: 0x1c70080, IN: ops txp_inside_proxy, priv (nil), ONW: ops txp_inside_proxy, priv (nil) +[2021/10/04 11:05:57:8981] N: lws_ss_proxy_deserialize_parse: ONWARD_CONNECT +[2021/10/04 11:05:57:8981] N: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_CREATING -> LWSSSCS_CONNECTING +[2021/10/04 11:05:57:8981] N: ++ [1316112|wsiSSPonw|0|GET/h1/libwebsockets.org/([1316112|wsiSScli|3|mintest-lws|v1|4294967295])] (1) +[2021/10/04 11:05:57:9173] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 696 +[2021/10/04 11:05:57:9309] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 896 +[2021/10/04 11:05:57:9513] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 512 +[2021/10/04 11:05:57:9663] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 264 +[2021/10/04 11:05:57:9860] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 472 +[2021/10/04 11:05:58:0126] N: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTING -> LWSSSCS_CONNECTED +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1744 +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 3344 +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 3720 +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 5392 +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 6752 +[2021/10/04 11:05:58:0136] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 6840 +[2021/10/04 11:05:58:0137] N: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_CONNECTED -> LWSSSCS_QOS_ACK_REMOTE +[2021/10/04 11:05:58:0137] N: [1316112|wsiSScli|3|mintest-lws|v1|4294967295]: lws_ss_check_next_state_ss: LWSSSCS_QOS_ACK_REMOTE -> LWSSSCS_DISCONNECTED +[2021/10/04 11:05:58:0138] N: -- [1316112|wsiSSPonw|0|GET/h1/libwebsockets.org/([1316112|wsiSScli|3|mintest-lws|v1|4294967295])] (0) 115.696ms +[2021/10/04 11:05:58:0197] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 464 +[2021/10/04 11:05:58:0555] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 464 +[2021/10/04 11:05:58:0936] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 848 +[2021/10/04 11:05:58:1322] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 552 +[2021/10/04 11:05:58:1647] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1016 +[2021/10/04 11:05:58:2000] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 448 +[2021/10/04 11:05:58:2313] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 888 +[2021/10/04 11:05:58:2514] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 264 +[2021/10/04 11:05:58:2562] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 464 +[2021/10/04 11:05:58:2639] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 952 +[2021/10/04 11:05:58:2972] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 2072 +[2021/10/04 11:05:58:3304] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1776 +[2021/10/04 11:05:58:3321] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1976 +[2021/10/04 11:05:58:3364] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1048 +[2021/10/04 11:05:58:3464] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1248 +[2021/10/04 11:05:58:3515] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 264 +[2021/10/04 11:05:58:3629] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 1088 +[2021/10/04 11:05:58:3706] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 272 +[2021/10/04 11:05:58:3714] N: lws_ss_serialize_rx_payload: dsh c2p 0, p2c 264 +... +``` diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/main.c b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/main.c similarity index 62% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/main.c rename to minimal-examples/ssproxy/ssproxy-custom-transport-uart/main.c index d66f25ddd..e16f24cf0 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/main.c +++ b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/main.c @@ -1,7 +1,7 @@ /* * lws-minimal-secure-streams-custom-proxy-transport * - * Written in 2010-2020 by Andy Green + * Written in 2010-2021 by Andy Green * * This file is made available under the Creative Commons CC0 1.0 * Universal Public Domain Dedication. @@ -15,17 +15,12 @@ #include #include -#if defined(__APPLE__) || defined(__linux__) -#include -#include -#endif - #include "private.h" -static int bad = 1, port = 0 /* unix domain socket */; +static int test_result = 1, port = 0 /* unix domain socket */; static const char *ibind = "/dev/ttyUSB0"; static lws_state_notify_link_t nl; -static struct lws_context *context; +static struct lws_context *cx; int interrupted; /* @@ -112,63 +107,15 @@ static const char * const default_ss_policy = "}" ; -static const char *canned_root_token_payload = - "grant_type=refresh_token" - "&refresh_token=Atzr|IwEBIJedGXjDqsU_vMxykqOMg" - "SHfYe3CPcedueWEMWSDMaDnEmiW8RlR1Kns7Cb4B-TOSnqp7ifVsY4BMY2B8tpHfO39XP" - "zfu9HapGjTR458IyHX44FE71pWJkGZ79uVBpljP4sazJuk8XS3Oe_yLnm_DIO6fU1nU3Y" - "0flYmsOiOAQE_gRk_pdlmEtHnpMA-9rLw3mkY5L89Ty9kUygBsiFaYatouROhbsTn8-jW" - "k1zZLUDpT6ICtBXSnrCIg0pUbZevPFhTwdXd6eX-u4rq0W-XaDvPWFO7au-iPb4Zk5eZE" - "iX6sissYrtNmuEXc2uHu7MnQO1hHCaTdIO2CANVumf-PHSD8xseamyh04sLV5JgFzY45S" - "KvKMajiUZuLkMokOx86rjC2Hdkx5DO7G-dbG1ufBDG-N79pFMSs7Ck5pc283IdLoJkCQc" - "AGvTX8o8I29QqkcGou-9TKhOJmpX8As94T61ok0UqqEKPJ7RhfQHHYdCtsdwxgvfVr9qI" - "xL_hDCcTho8opCVX-6QhJHl6SQFlTw13" - "&client_id=" - "amzn1.application-oa2-client.4823334c434b4190a2b5a42c07938a2d"; - -#if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4) -static char *aws_keyid = NULL, - *aws_key = NULL; -#endif - static int app_system_state_nf(lws_state_manager_t *mgr, lws_state_notify_link_t *link, int current, int target) { struct lws_context *context = lws_system_context_from_system_mgr(mgr); - lws_system_blob_t *ab = lws_system_get_blob(context, - LWS_SYSBLOB_TYPE_AUTH, 1 /* AUTH_IDX_ROOT */); - size_t size; - /* - * For the things we care about, let's notice if we are trying to get - * past them when we haven't solved them yet, and make the system - * state wait while we trigger the dependent action. - */ switch (target) { - case LWS_SYSTATE_REGISTERED: - size = lws_system_blob_get_size(ab); - if (size) - break; - - /* let's register our canned root token so auth can use it */ - lws_system_blob_direct_set(ab, - (const uint8_t *)canned_root_token_payload, - strlen(canned_root_token_payload)); - break; case LWS_SYSTATE_OPERATIONAL: if (current == LWS_SYSTATE_OPERATIONAL) { -#if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4) - - if (lws_aws_filesystem_credentials_helper( - "~/.aws/credentials", - "aws_access_key_id", - "aws_secret_access_key", - &aws_keyid, &aws_key)) - return -1; - - lws_ss_sigv4_set_aws_key(context, 0, aws_keyid, aws_key); -#endif /* * At this point we have DHCP, ntp, system auth token * and we can reasonably create the proxy @@ -178,18 +125,9 @@ app_system_state_nf(lws_state_manager_t *mgr, lws_state_notify_link_t *link, __func__); return -1; } + test_result = 0; } break; - case LWS_SYSTATE_POLICY_INVALID: - /* - * This is a NOP since we used direct set... but in a real - * system this could easily change to be done on the heap, then - * this would be important - */ - lws_system_blob_destroy(lws_system_get_blob(context, - LWS_SYSBLOB_TYPE_AUTH, - 1 /* AUTH_IDX_ROOT */)); - break; } return 0; @@ -199,30 +137,6 @@ static lws_state_notify_link_t * const app_notifier_list[] = { &nl, NULL }; -#if defined(LWS_WITH_SYS_METRICS) - -static int -my_metric_report(lws_metric_pub_t *mp) -{ - lws_metric_bucket_t *sub = mp->u.hist.head; - char buf[192]; - - do { - if (lws_metrics_format(mp, &sub, buf, sizeof(buf))) - lwsl_user("%s: %s\n", __func__, buf); - } while ((mp->flags & LWSMTFL_REPORT_HIST) && sub); - - /* 0 = leave metric to accumulate, 1 = reset the metric */ - - return 1; -} - -static const lws_system_ops_t system_ops = { - .metric_report = my_metric_report, -}; - -#endif - const struct lws_protocols *ppcols[] = { &protocol_sspc_serial_transport, NULL @@ -243,24 +157,19 @@ lws_transport_info_t info_serial = { .flags = LWSTMINFO_SERVER, }; -\ static void sigint_handler(int sig) { - lwsl_notice("%s\n", __func__); - interrupted = 1; - lws_cancel_service(context); + lws_default_loop_exit(cx); } int main(int argc, const char **argv) { struct lws_context_creation_info info; const char *p; - int n = 0; - memset(&info, 0, sizeof info); + lws_context_info_defaults(&info, default_ss_policy); lws_cmdline_option_handle_builtin(argc, argv, &info); - signal(SIGINT, sigint_handler); /* connect to ssproxy via UDS by default, else via tcp with this port */ @@ -278,8 +187,6 @@ int main(int argc, const char **argv) LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW | LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; info.fd_limit_per_thread = 1 + 26 + 1; - info.pss_policies_json = default_ss_policy; - info.port = CONTEXT_PORT_NO_LISTEN; info.pprotocols = ppcols; /* integrate us with lws system state management when context created */ @@ -290,38 +197,16 @@ int main(int argc, const char **argv) info.pt_serv_buf_size = (unsigned int)((6144 * 2) + 2048); info.max_http_header_data = (unsigned short)(6144 + 2048); -#if defined(LWS_WITH_SYS_METRICS) - info.system_ops = &system_ops; - info.metrics_prefix = "ssproxy"; -#endif - info.txp_ops_ssproxy = &lws_transport_mux_proxy_ops; info.txp_ssproxy_info = &info_mux; - context = lws_create_context(&info); - if (!context) { + cx = lws_create_context(&info); + if (!cx) { lwsl_err("lws init failed\n"); return 1; } - /* the event loop */ + lws_context_default_loop_run_destroy(cx); - do { - n = lws_service(context, 0); - } while (n >= 0 && !interrupted); - - bad = 0; - -#if defined(LWS_WITH_SECURE_STREAMS_AUTH_SIGV4) - if (aws_keyid) - free(aws_keyid); - if (aws_key) - free(aws_key); -#endif - - lws_context_destroy(context); - - lwsl_user("Completed: %s\n", bad ? "failed" : "OK"); - - return bad; + return lws_cmdline_passfail(argc, argv, test_result); } diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/private.h b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/private.h similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/private.h rename to minimal-examples/ssproxy/ssproxy-custom-transport-uart/private.h diff --git a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/transport-serial.c b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/transport-serial.c similarity index 98% rename from minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/transport-serial.c rename to minimal-examples/ssproxy/ssproxy-custom-transport-uart/transport-serial.c index 9d898ccb7..fcced4d4d 100644 --- a/minimal-examples/secure-streams/minimal-secure-streams-custom-proxy-transport/transport-serial.c +++ b/minimal-examples/ssproxy/ssproxy-custom-transport-uart/transport-serial.c @@ -7,7 +7,7 @@ * Universal Public Domain Dedication. * * - * This is a version of minimal-secure-streams-proxy that uses a custom + * This is an SS Proxy that uses the UART + lws_transport_mux as the custom * transport. */ diff --git a/minimal-examples/ssproxy/ssproxy-socket/CMakeLists.txt b/minimal-examples/ssproxy/ssproxy-socket/CMakeLists.txt new file mode 100644 index 000000000..db257bf4d --- /dev/null +++ b/minimal-examples/ssproxy/ssproxy-socket/CMakeLists.txt @@ -0,0 +1,32 @@ +project(lws-minimal-ss-proxy C) +cmake_minimum_required(VERSION 2.8.12) +find_package(libwebsockets CONFIG REQUIRED) +list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) +include(CheckCSourceCompiles) +include(LwsCheckRequirements) + +set(SRCS main.c) + +set(requirements 1) +require_lws_config(LWS_ROLE_H1 1 requirements) +require_lws_config(LWS_WITHOUT_CLIENT 0 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_PROXY_API 1 requirements) +require_lws_config(LWS_WITH_SECURE_STREAMS_STATIC_POLICY_ONLY 0 requirements) +require_lws_config(LWS_WITH_SYS_STATE 1 requirements) + +if (requirements) + add_executable(${PROJECT_NAME} ${SRCS}) + + if (websockets_shared) + target_link_libraries(${PROJECT_NAME} + websockets_shared + ${LIBWEBSOCKETS_DEP_LIBS}) + add_dependencies(${PROJECT_NAME} + websockets_shared) + else() + target_link_libraries(${PROJECT_NAME} + websockets + ${LIBWEBSOCKETS_DEP_LIBS}) + endif() +endif() diff --git a/minimal-examples/secure-streams/minimal-secure-streams-proxy/README.md b/minimal-examples/ssproxy/ssproxy-socket/README.md similarity index 100% rename from minimal-examples/secure-streams/minimal-secure-streams-proxy/README.md rename to minimal-examples/ssproxy/ssproxy-socket/README.md diff --git a/minimal-examples/ssproxy/ssproxy-socket/main.c b/minimal-examples/ssproxy/ssproxy-socket/main.c new file mode 100644 index 000000000..1fc96b706 --- /dev/null +++ b/minimal-examples/ssproxy/ssproxy-socket/main.c @@ -0,0 +1,198 @@ +/* + * lws-minimal-secure-streams-proxy + * + * Written in 2010-2021 by Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * + * This shows how to instantiate an SS Proxy... when clients are built with + * LWS_SS_USE_SSPC defined as a compiler preprocessor symbol, instead of doing + * their own SS networking, they connect out to an SS Proxy, by default at a + * Unix Domain Socket address @proxy.ss.lws, although you can also listen on + * TCP. + * + * The central networking management can then optimize connections, eg, sharing + * an h2 bundle to the same endpoint even though streams inside are from + * different processes. + * + * The proxy's policy can be a literal string, a local file, or brought in at + * init from over the network. In this example, there's a small literal policy + * that tells the proxy to download + * https://warmcat.com/policy/minimal-proxy-v4.2-v2.json and use that, for + * convenience that includes all the minimal example streamtypes. + */ + +#include +#include +#include + +static int test_result = 1, port = 0 /* unix domain socket */; +static const char *ibind = NULL; /* default to unix domain skt "proxy.ss.lws" */ +static lws_state_notify_link_t nl; +static struct lws_context *cx; + +/* + * We just define enough policy so it can fetch the latest one from warmcat.com + * securely. You'd probably want to provide a JSON file + */ + +static const char * const default_ss_policy = + "{" + "\"release\":" "\"01234567\"," + "\"product\":" "\"myproduct\"," + "\"schema-version\":" "1," + "\"retry\": [" /* named backoff / retry strategies */ + "{\"default\": {" + "\"backoff\": [" "1000," + "2000," + "3000," + "5000," + "10000" + "]," + "\"conceal\":" "5," + "\"jitterpc\":" "20," + "\"svalidping\":" "30," + "\"svalidhup\":" "35" + "}}" + "]," + "\"certs\": [" /* named individual certificates in BASE64 DER */ + /* + * Let's Encrypt certs for warmcat.com / libwebsockets.org + * + * We fetch the real policy from there using SS and switch to + * using that. + */ + "{\"dst_root_x3\": \"" + "MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/" + "MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT" + "DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow" + "PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD" + "Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB" + "AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O" + "rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq" + "OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b" + "xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw" + "7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD" + "aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV" + "HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG" + "SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69" + "ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr" + "AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz" + "R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5" + "JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo" + "Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ" + "\"}" + "]," + "\"trust_stores\": [" /* named cert chains */ + "{" + "\"name\": \"le_via_dst\"," + "\"stack\": [" + "\"dst_root_x3\"" + "]" + "}" + "]," + "\"s\": [{" + "\"captive_portal_detect\": {" + "\"endpoint\": \"connectivitycheck.android.com\"," + "\"http_url\": \"generate_204\"," + "\"port\": 80," + "\"protocol\": \"h1\"," + "\"http_method\": \"GET\"," + "\"opportunistic\": true," + "\"http_expect\": 204," + "\"http_fail_redirect\": true" + "}," + "\"fetch_policy\": {" + "\"endpoint\":" "\"warmcat.com\"," + "\"port\":" "443," + "\"protocol\":" "\"h1\"," + "\"http_method\":" "\"GET\"," + "\"http_url\":" "\"policy/minimal-proxy-v4.2-v2.json\"," + "\"tls\":" "true," + "\"opportunistic\":" "true," + "\"retry\":" "\"default\"," + "\"tls_trust_store\":" "\"le_via_dst\"" + "}}" + "}" +; + +static int +app_system_state_nf(lws_state_manager_t *mgr, lws_state_notify_link_t *link, + int current, int target) +{ + struct lws_context *context = lws_system_context_from_system_mgr(mgr); + + switch (target) { + case LWS_SYSTATE_OPERATIONAL: + if (current == LWS_SYSTATE_OPERATIONAL) { + /* + * At this point we have DHCP, ntp, system auth token + * and we can reasonably create the proxy + */ + if (lws_ss_proxy_create(context, ibind, port)) { + lwsl_err("%s: failed to create ss proxy\n", + __func__); + return -1; + } + test_result = 0; /* we passed if we started proxy */ + } + break; + } + + return 0; +} + +static lws_state_notify_link_t * const app_notifier_list[] = { + &nl, NULL +}; + +static void +sigint_handler(int sig) +{ + lws_default_loop_exit(cx); +} + +int main(int argc, const char **argv) +{ + struct lws_context_creation_info info; + const char *p; + + lws_context_info_defaults(&info, default_ss_policy); + lws_cmdline_option_handle_builtin(argc, argv, &info); + signal(SIGINT, sigint_handler); + + /* connect to ssproxy via UDS by default, else via tcp with this port */ + if ((p = lws_cmdline_option(argc, argv, "-p"))) + port = atoi(p); + + /* UDS "proxy.ss.lws" in abstract namespace, else this socket path; + * when -p given this can specify the network interface to bind to */ + if ((p = lws_cmdline_option(argc, argv, "-i"))) + ibind = p; + + lwsl_user("LWS secure streams Proxy [-d]\n"); + + info.options = LWS_SERVER_OPTION_EXPLICIT_VHOSTS | + LWS_SERVER_OPTION_H2_JUST_FIX_WINDOW_UPDATE_OVERFLOW | + LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; + info.fd_limit_per_thread = 1 + 26 + 1; + + nl.name = "app"; + nl.notify_cb = app_system_state_nf; + info.register_notifier_list = app_notifier_list; + + info.pt_serv_buf_size = (unsigned int)((6144 * 2) + 2048); + info.max_http_header_data = (unsigned short)(6144 + 2048); + + cx = lws_create_context(&info); + if (!cx) { + lwsl_err("lws init failed\n"); + return 1; + } + + lws_context_default_loop_run_destroy(cx); + + return lws_cmdline_passfail(argc, argv, test_result); +}