Project homepage Mailing List  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"en-US,en;q\u003d0.5", "gen_ut":1632364543, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"", "f":3, "items": [ { "schema":"libjg2-1", "oid":{ "oid": "99a4c1a2e1758157f90d9ebb4c710f1c480068af", "alias": [ "refs/heads/main"]},"tree": [ { "name": "READMEs","mode": "16384", "size":0}, { "name": "cmake","mode": "16384", "size":0}, { "name": "contrib","mode": "16384", "size":0}, { "name": "doc-assets","mode": "16384", "size":0}, { "name": "include","mode": "16384", "size":0}, { "name": "lib","mode": "16384", "size":0}, { "name": "lwsws","mode": "16384", "size":0}, { "name": "minimal-examples","mode": "16384", "size":0}, { "name": "minimal-examples-lowlevel","mode": "16384", "size":0}, { "name": "plugin-standalone","mode": "16384", "size":0}, { "name": "plugins","mode": "16384", "size":0}, { "name": "scripts","mode": "16384", "size":0}, { "name": "test-apps","mode": "16384", "size":0}, { "name": "win32port","mode": "16384", "size":0}, { "name": ".gitignore","mode": "33188", "size":790}, { "name": ".mailmap","mode": "33188", "size":103}, { "name": ".sai.json","mode": "33188", "size":22881}, { "name": "CMakeLists-implied-options.txt","mode": "33188", "size":11034}, { "name": "CMakeLists.txt","mode": "33188", "size":43175}, { "name": "Kconfig","mode": "33188", "size":857}, { "name": "LICENSE","mode": "33188", "size":14706}, { "name": "Makefile.projbuild","mode": "33188", "size":54}, { "name": "","mode": "33188", "size":7243}, { "name": "","mode": "33188", "size":2120}, { "name": "changelog","mode": "33188", "size":33257}, { "name": "","mode": "33188", "size":1659}, { "name": "libwebsockets.dox","mode": "33188", "size":15085}],"s":{"c":1632312427,"u": 2317}} ,{"schema":"libjg2-1", "cid":"bb98c34df1ee97d8a6577a0ab9da1205", "oid":{ "oid": "99a4c1a2e1758157f90d9ebb4c710f1c480068af", "alias": [ "refs/heads/main"]},"blobname": "", "blob": "[![CI status](]( [![Coverity Scan Build Status](]( [![CII Best Practices](]( [![Codacy Badge](](\\u0026amp;utm_medium\u003dreferral\u0026amp;utm_content\u003dwarmcat/libwebsockets\u0026amp;utm_campaign\u003dBadge_Grade) [![Total alerts](\u003dlgtm\u0026logoWidth\u003d18)]( [![Language grade: C/C++](\u003dlgtm\u0026logoWidth\u003d18)]( [![Language grade: JavaScript](\u003dlgtm\u0026logoWidth\u003d18)](\n\n# Libwebsockets\n\nLibwebsockets is a simple-to-use, MIT-license, pure C library providing client and server\nfor **http/1**, **http/2**, **websockets**, **MQTT** and other protocols in a security-minded,\nlightweight, configurable, scalable and flexible way. It's easy to build and\ncross-build via cmake and is suitable for tasks from embedded RTOS through mass\ncloud serving.\n\nIt supports a lot of lightweight ancilliary implementations for things like JSON,\nCBOR, JOSE, COSE, and supports OpenSSL and MbedTLS v2 and v3 out of the box for everything.\nIt's very gregarious when it comes to event loop sharing, supporting libuv, libevent, libev,\nsdevent, glib and uloop, as well as custom event libs.\n\n[100+ independent minimal examples]( for various scenarios, CC0-licensed\n(public domain) for cut-and-paste, allow you to get started quickly.\n\n[There are a lot of READMEs]( on a variety of topics.\n\n[We do a huge amount of CI testing per push](, currently 582 builds on 30 platforms.\n\n![overview](./doc-assets/lws-overview.png)\n\nNews\n----\n\n## Lws examples switching to Secure Streams\n\n![Secure Streams direct](./doc-assets/ss-api1.png)\n\n**Secure Streams** support in lws was introduced a couple of years ago, it's a\nhigher-level interface to lws `wsi`-level apis that simplifies connectivity by\nsegregating connection policy like protocol and endpoint information into a\nseparate [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\ndetails of the wire protocol as possible are hidden or moved to the policy, so\nuser code is almost identical even if the wire protocol changes.\n\nThe user code just asks to create a SS by \u0022streamtype name\u0022, it is created\naccording to the details (protocol, endpoint, etc) under the same name in the\npolicy.\n\nKey policy entries like endpoint can contain `${metadata-name}` string\nsubstitutions to handle runtime adaptations via metadata. h1, h2, ws and mqtt\nare supported.\n\nAs a layer on top of the `wsi` apis, SS provides a higher-level way to access\nthe existing wsi-level capabilities, both kinds of API will remain supported.\nSecure Streams are longer-lived than a single wsi, so an SS can coordinate\nretries by itself. SS-based user code is typically significantly smaller and\nmore maintainable than wsi layer.\n\nIn main branch I have moved the older examples into `./minimal-examples-lowlevel`\nand am starting to port more cases from there into SS-based examples.\n\n### Comparison between wsi and SS level lws usage\n\n|Feature|\u0022low-level\u0022 wsi way|Secure Streams way|\n|---|---|---|\n|Create context|code|same|\n|Loop support, sul scheduler|default, event libs|same|\n|Supports comms mode|Client, Server, Raw|same|\n|Supports protocols|h1, h2, ws, mqtt (client)|same|\n|TLS support|mbedtls (including v3), openssl (including v3), wolfssl, boringssl, libressl|same|\n|Serializable, proxiable, muxable, transportable|No|Yes|\n|Auto-allocated per-connection user object|pss specified in lws_protocols|Specified in ss info struct|\n|Connection User API|Protocol-specific lws_protocols cbs (\u003e 100)|SS API (rx, tx, state callbacks only)|\n|Sending adaptation|lws_callback_on_writeable() + WRITEABLE|lws_ss_request_write() + tx() cb|\n|Sending buffer|User-chosen + malloc'd partial handling|SS-provided, no partials|\n|Create vhosts|code|**JSON policy**|\n|TLS validation|cert bundle or code|**JSON policy**, or cert bundle|\n|Connection retry / backoff|code|**JSON policy**, Auto|\n|Nailing up|code|**JSON policy**, Auto|\n|Endpoint and protocol details|spread around the code|**JSON policy**|\n|Protocol selection, pipeline / stream sharing|code|**JSON policy**|\n|ws subprotocol selection|code|**JSON policy**|\n|ws binary / text|code|**JSON policy**|\n|Protocol-specific metadata|Protocol-specific apis in code (eg, lws_hdr)|**JSON policy**, generic metadata apis in code|\n|Connection validity rules|struct|**JSON policy**, Auto|\n|Stream as Long Poll|code|**JSON policy**|\n|Auth|code|**JSON policy** + automatic rotation if provider supported, else code|\n\n### Serialized Secure Streams\n\n![Secure Streams direct](./doc-assets/ss-api2.png)\n\nSecure Streams APIs are also **serializable**, the exact same client code can\nfulfil the connection directly in the same process as you would expect, or\nforward the actions, metadata and payloads to an [SS Proxy](./minimal-examples/ssproxy/ssproxy-socket) that owns the policy\nover a Unix Domain or TCP socket connection to be fulfilled centrally. This\nallows, eg, h2 streams from different processes sharing a single connection.\n\n![Secure Streams direct](./doc-assets/ss-api3.png)\n\nThe serialized SS can also travel over generic transports like UART, an [example\nis provided implementing the Binance example on an RPi Pico](./minimal-examples/embedded/pico/pico-sspc-binance) with a UART transport\nto a [UART transport SS proxy](./minimal-examples/ssproxy/ssproxy-custom-transport-uart), where the pico itself has no network stack, tls, compression or\nwss stack, but can send and receive to and from the endpoint as if it did.\n\nThe optional `lws_trasport_mux` is used to interpose between the UART transport\nand the SSPC layer, allowing a single pipe to carry many separate SS connections.\n\nThe user SS code is identical however it is transported, muxed and fulfilled.\n\n\n## v4.2 is released\n\nSee the [changelog](\n\n## Support\n\nThis is the libwebsockets C library for lightweight websocket clients and\nservers. For support, visit\n\n\n\nand consider joining the project mailing list at\n\n\n\nYou can get the latest version of the library from git:\n\n-\n\nDoxygen API docs for development:\n\n","s":{"c":1632312427,"u": 2604}} ],"g": 717,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "7d0a"}