Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1544759380, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ { "schema":"libjg2-1", "oid":{ "oid": "ca117899fe1e65b57021e420be69d017dfc18de8", "alias": [ "refs/heads/master"]},"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": "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":698}, { "name": ".mailmap","mode": "33188", "size":103}, { "name": ".travis.yml","mode": "33188", "size":2549}, { "name": "CMakeLists.txt","mode": "33188", "size":79724}, { "name": "Kconfig","mode": "33188", "size":857}, { "name": "LICENSE","mode": "33188", "size":28754}, { "name": "Makefile.projbuild","mode": "33188", "size":54}, { "name": "README.md","mode": "33188", "size":12944}, { "name": "appveyor.yml","mode": "33188", "size":3004}, { "name": "changelog","mode": "33188", "size":40786}, { "name": "component.mk","mode": "33188", "size":1659}, { "name": "libwebsockets.dox","mode": "33188", "size":13505}],"s":{"c":1544703687,"u": 2249}} ,{"schema":"libjg2-1", "cid":"ccd13801d862685485e33e4f87dab054", "oid":{ "oid": "ca117899fe1e65b57021e420be69d017dfc18de8", "alias": [ "refs/heads/master"]},"blobname": "README.md", "blob": "[![Travis Build Status](https://travis-ci.org/warmcat/libwebsockets.svg)](https://travis-ci.org/warmcat/libwebsockets) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/qfasji8mnfnd2r8t?svg\u003dtrue)](https://ci.appveyor.com/project/lws-team/libwebsockets) [![Coverity Scan Build Status](https://scan.coverity.com/projects/3576/badge.svg)](https://scan.coverity.com/projects/3576) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2266/badge)](https://bestpractices.coreinfrastructure.org/projects/2266) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/144fb195a83046e484a75c8b4c6cfc99)](https://www.codacy.com/app/lws-team/libwebsockets?utm_source\u003dgithub.com\u0026amp;utm_medium\u003dreferral\u0026amp;utm_content\u003dwarmcat/libwebsockets\u0026amp;utm_campaign\u003dBadge_Grade)\n\n# Libwebsockets\n\nLibwebsockets is a simple-to-use, pure C library providing client and server\nfor **http/1**, **http/2**, **websockets** 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\n[50 minimal examples](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples) for\nvarious scenarios, CC0-licensed (public domain) for cut-and-paste, allow you to get started quickly.\n\n![overview](./doc-assets/lws-overview.svg)\n\nNews\n----\n\n## New features on master\n\n - **`lws-genec` ECDSA** - JWS-compatible ECDSA is supported on both OpenSSL and mbedtls... ECDH-ES is work in progress\n\n - **`jws`** - JWS (RFC7515) is now supported for none, HS256/384/512, RS256/384/512, and ES256/384/512, on both OpenSSL and mbedtls\n [jws api](https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-jws.h), \n [jws unit tests](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/api-tests/api-test-jose/jws.c)\n\n - **`jwk`** - JWK (RFC7517) now supports oct, RSA and EC keys including JSON key arrays on both OpenSSL and mbedtls\n\n - **`lws-genrsa` OAEP + PSS support** - in addition to PKCS#1 1.5 padding, OAEP and PSS are\n now supported on both mbedtls and openssl backends.\n\n - **`lws-genaes` Generic AES crypto** - thin api layer works identically with both mbedtls and openssl\n backends. Supports CBC, CFB128, CFB8, CTR, ECB, OFB, XTS and GCM variants. Unit tests in CI.\n [genaes api](https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-genaes.h),\n [api test](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/api-tests/api-test-gencrypto),\n CMake config: `-DLWS_WITH_GENAES\u003d1`\n\n - **http fallback support** - you can specify a role and protocol to apply if non-http or non-tls\n packets arrive at an http(s) listen port. For example, you can specify that the new `raw proxy`\n role + protocol should be used, to proxy your sshd port over :443 or :80. Without affecting\n normal http(s) serving on those ports but allowing, eg, `ssh -p 443 invalid@libwebsockets.org`.\n [http fallback docs](https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.http-fallback.md)\n\n - **raw tcp proxy role and protocol** - adding raw tcp proxying is now trivial using the built-in lws\n implementation. You can control the onward connection using a pvo in the format \u0022ipv4:server.com:port\u0022\n [raw proxy minimal example](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/raw/minimal-raw-proxy),\n [raw proxy docs](https://libwebsockets.org/git/libwebsockets/tree/plugins/raw-proxy),\n Cmake config: `-DLWS_ROLE_RAW_PROXY\u003d1 -DLWS_WITH_PLUGINS\u003d1`\n\n - **deaddrop HTML file upload protocol** - protocol and minimal example for file upload and sharing using\n drag and drop and a file picker. Integrated with basic auth, uploaded files marked with upload user,\n and files owned by the authenticated user may be deleted via the UI. Supports multiple simultaneous\n uploads both by drag-and-drop and from the file picker.\n [deaddrop minimal example](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/http-server/minimal-http-server-deaddrop)\n\n - **basic auth for ws(s)** - You can apply basic auth credential requirement to ws connections same\n as on mounts now. Just add a pvo \u0022basic-auth\u0022 with the value being the credentials file path when\n enabling the ws protocol for the vhost.\n\n## v3.1 released: new features in v3.1\n\n - **lws threadpool** - lightweight pool of pthreads integrated to lws wsi, with all\n synchronization to event loop handled internally, queue for excess tasks\n [threadpool docs](https://libwebsockets.org/git/libwebsockets/tree/lib/misc/threadpool), \n [threadpool minimal example](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/ws-server/minimal-ws-server-threadpool), \n Cmake config: `-DLWS_WITH_THREADPOOL\u003d1`\n\n - **libdbus support** integrated on lws event loop\n [lws dbus docs](https://libwebsockets.org/git/libwebsockets/tree/lib/roles/dbus), \n [lws dbus client minimal examples](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/dbus-client), \n [lws dbus server minimal examples](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/dbus-server), \n Cmake config: `-DLWS_ROLE_DBUS\u003d1`\n\n - **lws allocated chunks (lwsac)** - helpers for optimized mass allocation of small\n objects inside a few larger malloc chunks... if you need to allocate a lot of\n inter-related structs for a limited time, this removes per-struct allocation\n library overhead completely and removes the need for any destruction handling\n [lwsac docs](https://libwebsockets.org/git/libwebsockets/tree/lib/misc/lwsac), \n [lwsac minimal example](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/api-tests/api-test-lwsac), \n Cmake Config: `-DLWS_WITH_LWSAC\u003d1`\n\n - **lws tokenizer** - helper api for robustly tokenizing your own strings without\n allocating or adding complexity. Configurable by flags for common delimiter\n sets and comma-separated-lists in the tokenizer. Detects and reports syntax\n errors.\n [lws_tokenize docs](https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-tokenize.h), \n [lws_tokenize minimal example / api test](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/api-tests/api-test-lws_tokenize)\n\n - **lws full-text search** - optimized trie generation, serialization,\n autocomplete suggestion generation and instant global search support extensible\n to huge corpuses of UTF-8 text while remaining super lightweight on resources.\n [full-text search docs](https://libwebsockets.org/git/libwebsockets/tree/lib/misc/fts), \n [full-text search minimal example / api test](https://libwebsockets.org/git/libwebsockets/tree/minimal-examples/api-tests/api-test-fts), \n [demo](https://libwebsockets.org/ftsdemo/), \n [demo sources](https://libwebsockets.org/git/libwebsockets/tree/plugins/protocol_fulltext_demo.c), \n Cmake config: `-DLWS_WITH_FTS\u003d1 -DLWS_WITH_LWSAC\u003d1`\n\n - **gzip + brotli http server-side compression** - h1 and h2 detection of client support\n for server compression, and auto-application to files with mimetypes \u0022text/*\u0022,\n \u0022application/javascript\u0022 and \u0022image/svg.xml\u0022.\n Cmake config: `-DLWS_WITH_HTTP_STREAM_COMPRESSION\u003d1` for gzip, optionally also give\n `-DLWS_WITH_HTTP_BROTLI\u003d1` for preferred `br` brotli compression\n\n - **managed disk cache** - API for managing a directory containing cached files\n with hashed names, and automatic deletion of LRU files once the cache is\n above a given limit.\n [lws diskcache docs](https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-diskcache.h), \n Cmake config: `-DLWS_WITH_DISKCACHE\u003d1`\n\n - **http reverse proxy** - lws mounts support proxying h1 or h2 requests to\n a local or remote IP, or unix domain socket over h1. This allows microservice\n type architectures where parts of the common URL space are actually handled\n by external processes which may be remote or on the same machine.\n [lws gitohashi serving](https://libwebsockets.org/git/) is handled this way.\n [unix domain sockets reverse proxy docs](https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.unix-domain-reverse-proxy.md), \n CMake config: `-DLWS_WITH_HTTP_PROXY\u003d1` and `-DLWS_UNIX_SOCK\u003d1` for Unix Domain Sockets\n\n - **update minimal examples for strict Content Security Policy** the minimal\n examples now show the best practices around Content Security Policy and\n disabling inline Javascript. Updated examples that are served with the\n recommended security restrictions show a new \u0022Strict Content Security Policy\u0022\n graphic. [Read how to upgrade your applications to use a strict CSP](https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.content-security-policy.md).\n\n - **release policy docs** - unsure what branch, version or tag to use, or how\n to follow master cleanly? [Read the release policy docs](https://libwebsockets.org/git/libwebsockets/tree/READMEs/README.release-policy.md)\n which explain how and why lws is developed, released and maintained.\n\n## v3.0.1 released\n\nSee the git log for the list of fixes.\n\n## v3.0.0 released\n\nSee the changelog for info https://libwebsockets.org/git/libwebsockets/tree/changelog?h\u003dv3.0-stable\n\n## Major CI improvements for QA\n\nThe Travis build of lws done on every commit now runs:\n\nTests|Count|Explanation\n---|---|---\nBuild / Linux / gcc|16|-Wall -Werror cmake config variants\nBuild / Mac / Clang|16|-Wall -Werror cmake config variants\nBuild / Windows / MSVC|7|default\nSelftests|openssl:43, mbedtls:43|minimal examples built and run against each other and remote server\nattack.sh|225|Correctness, robustness and security tests for http parser\nAutobahn Server|480|Testing lws ws client, including permessage-deflate\nAutobahn Client|480|Testing lws ws server, including permaessage-deflate\nh2spec|openssl:146, mbedtls:146|Http/2 server compliance suite (in strict mode)\nh2load|openssl:6, mbedtls:6|Http/2 server load tool (checks 10K / 100K in h1 and h2, at 1, 10, 100 concurrency)\nh2load SMP|6|Http/2 and http/1.1 server load checks on SMP server build\n\nThe over 1,500 tests run on every commit take 1hr 15 of compute time to complete.\nIf any problems are found, it breaks the travis build, generating an email.\n\nCodacy also checks every patch and the information used to keep lws at zero issues.\n\nCurrent master is checked by Coverity at least daily and kept at zero issues.\n\nCurrent master passes all the tests and these new CI arrangements will help\nkeep it that way.\n\n## Lws has the first official ws-over-h2 server support\n\n![wss-over-h2](./doc-assets/wss2.png)\n\nThere's a new [RFC](https://tools.ietf.org/html/rfc8441) that enables multiplexing ws connections\nover an http/2 link. Compared to making individual tcp and tls connections for\neach ws link back to the same server, this makes your site start up radically\nfaster, and since all the connections are in one tls tunnel, with considerable memory\nreduction serverside.\n\nTo enable it on master you just need -DLWS_WITH_HTTP2\u003d1 at cmake. No changes to\nexisting code are necessary for either http/2 (if you use the official header creation\napis if you return your own headers, as shown in the test apps for several versions)\nor to take advantage of ws-over-h2. When built with http/2 support, it automatically\nfalls back to http/1 and traditional ws upgrade if that's all the client can handle.\n\nCurrently only Chrome Canary v67 supports this ws-over-h2 encapsulation (chrome\nmust be started with `--enable-websocket-over-http2` switch to enable it currently),\nand patches exist for Firefox. Authors of both browser implementations tested\nagainst the lws server implementation.\n\n## New \u0022minimal examples\u0022\n\nhttps://libwebsockets.org/git/libwebsockets/tree/minimal-examples\n\nThese are like the test apps, but focus on doing one thing, the best way, with the\nminimum amount of code. For example the minimal-http-server serves the cwd on\nhttp/1 or http/2 in 50 LOC. Same thing with tls is just three more lines.\n\nThey build standalone, so it's easier to copy them directly to start your own project; they\nare CC0 licensed (public domain) to facilitate that.\n\n## Windows binary builds\n\n32- and 64-bit Windows binary builds are available via Appveyor. Visit\n[lws on Appveyor](https://ci.appveyor.com/project/lws-team/libwebsockets),\nclick on a build, the ARTIFACTS, and unzip the zip file at `C:\u005cProgram Files (x86)/libwebsockets`.\n\n## Support\n\nThis is the libwebsockets C library for lightweight websocket clients and\nservers. For support, visit\n\n https://libwebsockets.org\n\nand consider joining the project mailing list at\n\n https://libwebsockets.org/mailman/listinfo/libwebsockets\n\nYou can get the latest version of the library from git:\n\n- https://libwebsockets.org/git\n\nDoxygen API docs for master: https://libwebsockets.org/lws-api-doc-master/html/index.html\n\n","s":{"c":1544703687,"u": 2836}} ],"g": 498,"chitpc": 0,"ehitpc": 0, "indexed":0 }