It was the client side cookies that took up too much space - and nothing to do with the command protocol payload size after all

Links:

 static struct lws_protocols protocols[] =
{
        // first protocol must always be HTTP handler
        {       "http-only", callback_http,     0       },
        { "lws-node-protocol", callback_lws_node, sizeof(struct per_session_data__lws_node) },
        {       nullptr, nullptr, 0 }           // End of list
};

        struct lws_context_creation_info info{};
        info.port = port;
        info.iface = interface;
        info.protocols = protocols;
        info.max_http_header_data = 18*1024; // <-- This shouldn't be here!
        //info.extensions = lws_get_internal_extensions(); // DEPRECATED

        if(!use_ssl)
        {
                info.ssl_cert_filepath = cert_path;
                info.ssl_private_key_filepath = nullptr;
        }
        else
        {
                info.ssl_cert_filepath =
                        LOCAL_RESOURCE_PATH"/libwebsockets-test-server.pem";
                info.ssl_private_key_filepath =
                        LOCAL_RESOURCE_PATH"/libwebsockets-test-server.key.pem";
        }

The error I get:

[2020/06/19 17:08:31:8313] NOTICE: Initial logging level 7
[2020/06/19 17:08:31:8313] NOTICE: Libwebsockets version: 2.0.3 unknown-build-hash
[2020/06/19 17:08:31:8314] NOTICE: IPV6 not compiled in
[2020/06/19 17:08:31:8314] NOTICE: libev support compiled in but disabled
[2020/06/19 17:08:31:8315] NOTICE: libuv support compiled in but disabled
[2020/06/19 17:08:31:8316] NOTICE:  Threads: 1 each 1024 fds
[2020/06/19 17:08:31:8316] NOTICE:  mem: platform fd map:  8192 bytes
[2020/06/19 17:08:31:8317] NOTICE:  Compiled with OpenSSL support
[2020/06/19 17:08:31:8318] NOTICE:  SSL disabled: no LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT
[2020/06/19 17:08:31:8318] NOTICE: Creating Vhost 'default' port 80, 2 protocols
[2020/06/19 17:08:31:8319] NOTICE:  Listening on port 80
[2020/06/19 17:08:31:8320] NOTICE:  mem: per-conn:          920 bytes + protocol rx buf
[2020/06/19 17:08:31:8320] NOTICE:  canonical_hostname = munia
[2020/06/19 17:08:31:8822] NOTICE: lws_protocol_init
[2020/06/19 17:08:36:5518] ERR: Ran out of header data space
[2020/06/19 17:08:36:5529] ERR: Ran out of header data space
[2020/06/19 17:08:36:5537] ERR: Ran out of header data space
[2020/06/19 17:08:36:5550] ERR: Ran out of header data space
[2020/06/19 17:08:36:5557] ERR: Ran out of header data space
[2020/06/19 17:08:36:5563] ERR: Ran out of header data space
[2020/06/19 17:08:36:5568] ERR: Ran out of header data space
[2020/06/19 17:08:36:5572] ERR: Ran out of header data space
[2020/06/19 17:08:36:5577] ERR: Ran out of header data space
[2020/06/19 17:08:36:5582] ERR: Ran out of header data space