{"id":15357697,"url":"https://github.com/nauja/libws","last_synced_at":"2025-03-27T14:47:51.332Z","repository":{"id":65248688,"uuid":"588178584","full_name":"Nauja/libws","owner":"Nauja","description":"Wrapper over libwebsockets for easy ws","archived":false,"fork":false,"pushed_at":"2023-01-24T16:41:07.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-01T18:45:39.714Z","etag":null,"topics":["c","cmake","library","lightweight","network","portable","websockets"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Nauja.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-12T14:09:56.000Z","updated_at":"2024-10-24T18:51:10.000Z","dependencies_parsed_at":"2023-02-13T23:30:54.880Z","dependency_job_id":null,"html_url":"https://github.com/Nauja/libws","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nauja%2Flibws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nauja%2Flibws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nauja%2Flibws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nauja%2Flibws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nauja","download_url":"https://codeload.github.com/Nauja/libws/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245865388,"owners_count":20685223,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","cmake","library","lightweight","network","portable","websockets"],"created_at":"2024-10-01T12:38:06.866Z","updated_at":"2025-03-27T14:47:51.308Z","avatar_url":"https://github.com/Nauja.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libws\n\n[![CI](https://github.com/Nauja/libws/actions/workflows/CI.yml/badge.svg)](https://github.com/Nauja/libws/actions/workflows/CI.yml)\n[![CI Docs](https://github.com/Nauja/libws/actions/workflows/CI_docs.yml/badge.svg)](https://github.com/Nauja/libws/actions/workflows/CI_docs.yml)\n[![Documentation Status](https://readthedocs.org/projects/libws/badge/?version=latest)](https://libws.readthedocs.io/en/latest/?badge=latest)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/Nauja/libws/master/LICENSE)\n\nWrapper over [libwebsockets](https://libwebsockets.org/) for websockets.\n\n## Why\n\nlibwebsockets is a popular library with a generic interface for http/1, http/2, websockets, MQTT,\nand while it's great to have a generic interface, it also makes it more complicated to get started\nif you only want to use it for websockets. So, this library aims to provide a simpler interface\nover libwebsockets to remove some of the boilerplate required to create a websockets server or\nclient.\n\n## Examples\n\nWIP\n\n## Build Manually\n\nCopy the files [ws.c](https://github.com/Nauja/libws/blob/main/ws.c) and [ws.h](https://github.com/Nauja/libws/blob/main/ws.h) into an existing project.\n\nComment or uncomment the defines at the top of `ws.h` depending on your configuration:\n\n```c\n/* Define to 1 if you have the \u003cstdio.h\u003e header file. */\n#ifndef HAVE_STDIO_H\n#define HAVE_STDIO_H 1\n#endif\n\n/* Define to 1 if you have the \u003cstdlib.h\u003e header file. */\n#ifndef HAVE_STDLIB_H\n#define HAVE_STDLIB_H 1\n#endif\n\n/* Define to 1 if you have the \u003csys/stat.h\u003e header file. */\n#ifndef HAVE_SYS_STAT_H\n#define HAVE_SYS_STAT_H 1\n#endif\n\n...\n```\n\nYou should now be able to compile this library correctly.\n\n## Build with CMake\n\nTested with CMake \u003e= 3.13.4:\n\n```\ngit clone https://github.com/Nauja/libws.git\ncd libws\ngit submodule init\ngit submodule update\nmkdir build\ncd build\ncmake ..\n```\n\nCMake will correctly configure the defines at the top of [ws.h](https://github.com/Nauja/libws/blob/main/ws.h) for your system.\n\nYou can then build this library manually as described above, or by using:\n\n```\nmake\n```\n\nThis will generate `libws.a` if building as a static library and `liblibws.so` in the `build` directory.\n\nYou can change the build process with a list of different options that you can pass to CMake. Turn them on with `On` and off with `Off`:\n  * `-DLIBWS_STATIC=On`: Enable building as static library. (on by default)\n  * `-DLIBWS_UNIT_TESTING=On`: Enable building the tests. (on by default)\n  * `-DLIBWS_DOXYGEN=On`: Enable building the docs. (off by default)\n\n## Build with Visual Studio\n\nGenerate the Visual Studio solution with:\n\n```\nmkdir build\ncd build\ncmake .. -G \"Visual Studio 16 2019\"\n```\n\nYou can now open `build/libws.sln` and compile the library.\n\n## License\n\nLicensed under the [MIT](https://github.com/Nauja/libws/blob/main/LICENSE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnauja%2Flibws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnauja%2Flibws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnauja%2Flibws/lists"}