libwebsockets v3.1.0 Release Notes

Release Date: 2018-11-23 // over 5 years ago
    • CHANGE: REMOVED: lws_client_connect() and lws_client_connect_extended() compatibility apis for lws_client_connect_via_info() have been marked as deprecated for several versions and are now removed. Use lws_client_connect_via_info() directly instead.

    • CHANGE: CMAKE:

      • LWS_WITH_HTTP2: now defaults ON
    • CHANGE: Minimal examples updated to use Content Security Policy best practices, using LWS_SERVER_OPTION_HTTP_HEADERS_SECURITY_BEST_PRACTICES_ENFORCE vhost option flag and disabling of inline style and scripts. A side-effect of this is that buffers used to marshal headers have to be prepared to take more content than previously... LWS_RECOMMENDED_MIN_HEADER_SPACE (2048 currently) is available for user (and internal) use to logically tie the buffer size to this usecase (and follow future increases).

    • NEW: CMAKE

      • LWS_FOR_GITOHASHI: sets various cmake options suitable for gitohashi
      • LWS_WITH_ASAN: for Linux, enable build with ASAN

      Don't forget LWS_WITH_DISTRO_RECOMMENDED, which enables a wide range of lws options suitable for a distro build of the library.

    • NEW: lws threadpool - lightweight pool of pthreads integrated to lws wsi, with all synchronization to event loop handled internally, queue for excess tasks threadpool docs threadpool minimal example Cmake config: -DLWS_WITH_THREADPOOL=1

    • NEW: libdbus support integrated on lws event loop lws dbus docs lws dbus client minimal examples lws dbus server minimal examples Cmake config: -DLWS_ROLE_DBUS=1

    • NEW: lws allocated chunks (lwsac) - helpers for optimized mass allocation of small objects inside a few larger malloc chunks... if you need to allocate a lot of inter-related structs for a limited time, this removes per-struct allocation library overhead completely and removes the need for any destruction handling lwsac docs lwsac minimal example Cmake Config: -DLWS_WITH_LWSAC=1

    • NEW: lws tokenizer - helper api for robustly tokenizing your own strings without allocating or adding complexity. Configurable by flags for common delimiter sets and comma-separated-lists in the tokenizer. Detects and reports syntax errors. lws_tokenize docs lws_tokenize minimal example / api test

    • NEW: lws full-text search - optimized trie generation, serialization, autocomplete suggestion generation and instant global search support extensible to huge corpuses of UTF-8 text while remaining super lightweight on resources. full-text search docs full-text search minimal example / api test demo demo sources Cmake config: -DLWS_WITH_FTS=1 -DLWS_WITH_LWSAC=1

    • NEW: gzip + brotli http server-side compression - h1 and h2 automatic advertising of server compression and application to files with mimetypes "text/*", "application/javascript" and "image/svg.xml". Cmake config: -DLWS_WITH_HTTP_STREAM_COMPRESSION=1, -DLWS_WITH_HTTP_BROTLI=1

    • NEW: managed disk cache - API for managing a directory containing cached files with hashed names, and automatic deletion of LRU files once the cache is above a given limit. lws diskcache docs Cmake config: -DLWS_WITH_DISKCACHE=1

    • NEW: http reverse proxy - lws mounts support proxying h1 or h2 requests to a local or remote IP, or unix domain socket over h1. This allows microservice type architectures where parts of the common URL space are actually handled by external processes which may be remote or on the same machine. lws gitohashi serving is handled this way. CMake config: -DLWS_WITH_HTTP_PROXY=1

    • NEW: lws_buflist - internally several types of ad-hoc malloc'd buffer have been replaced by a new, exported api struct lws_buflist. This allows multiple buffers to be chained and drawn down in strict FIFO order.

    • NEW: In the case of h1 upgrade, the connection header is checked to contain "upgrade". The vhost flag LWS_SERVER_OPTION_VHOST_UPG_STRICT_HOST_CHECK also causes the Host: header to be confirmed to match the vhost name and listen port.

    • NEW: If no 404 redirect for lws_return_http_status() is specified for the vhost, the status page produced will try to bring in a stylesheet /error.css. This allows you to produce styled 404 or other error pages with logos, graphics etc. See https://libwebsockets.org/git/badrepo for an example of what you can do with it.