{"id":28414960,"url":"https://github.com/interlinked1/libwss","last_synced_at":"2025-06-25T09:32:55.505Z","repository":{"id":172205927,"uuid":"648973531","full_name":"InterLinked1/libwss","owner":"InterLinked1","description":"WebSocket server library","archived":false,"fork":false,"pushed_at":"2025-02-23T23:47:18.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-03T21:28:23.386Z","etag":null,"topics":["websocket-library","websocket-protocol","websocket-server","websockets"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InterLinked1.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-03T11:30:05.000Z","updated_at":"2025-02-23T23:47:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a824c7d5-25d6-446f-a3c8-6c34223a9c0b","html_url":"https://github.com/InterLinked1/libwss","commit_stats":null,"previous_names":["interlinked1/libwss"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/InterLinked1/libwss","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterLinked1%2Flibwss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterLinked1%2Flibwss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterLinked1%2Flibwss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterLinked1%2Flibwss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InterLinked1","download_url":"https://codeload.github.com/InterLinked1/libwss/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InterLinked1%2Flibwss/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261844623,"owners_count":23218390,"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":["websocket-library","websocket-protocol","websocket-server","websockets"],"created_at":"2025-06-03T12:30:23.881Z","updated_at":"2025-06-25T09:32:55.496Z","avatar_url":"https://github.com/InterLinked1.png","language":"C","readme":"# libwss\n\nThis is `libwss`, yet another WebSocket library (Y.A.W.L.). I wrote it because, in looking for a C websocket library for a project, I didn't really find any that were quite what I was looking for, so I wrote my own.\n\n## Caveats\n\nA few things to keep in mind:\n\nThis is a simple and relatively low-level *WebSocket server (and client) library*, **not** a *WebSocket server*. The library can be used to build a WebSocket server, but it is not itself a server. This contrasts with many other libraries that themselves can operate a server for you. This library does not do that, since it's intended for use in custom WebSocket server applications. The library implements the WebSocket protocol, and doesn't do anything else.\n\nBecause this is not a server, it does not parse HTTP requests or handle the HTTP to WebSocket upgrade for you. It is expected you do this, if needed, in your WebSocket server application *before* calling `wss_client_new`. Likewise, listening on a socket, accepting clients, and closing sockets is your responsibility.\n\nThis library does not keep track of clients for you, or manipulate them for you, in any way. Your server or application is responsible for that. For example, if you want to broadcast data received from one client to all the other ones, you could store a linked list of clients and iterate over them and write to each one.\n\nWhile the type of client handling is not strictly dictated by this library, it is more geared towards multithreaded programs. However, the library by itself does not do any locking. Your application should surround calls to `wss_write` with a mutex as needed to ensure writes are properly serialized.\n\nA common paradigm in WebSocket libraries is to provide a set of callbacks, such as `on_open`, `on_close`, and `on_message` to WebSocket applications. The library itself does not do this, but this can be implemented as a thin abstraction on top of the library. The interface is up to the application.\n\n## Documentation\n\nAll public functions are documented in `wss.h`.\n\nFor an example of building a WebSocket server using `libwss`, you can refer to the `ws_handler` function in the [net_ws](https://github.com/InterLinked1/lbbs/blob/master/nets/net_ws.c) LBBS module, for which this library was originally written. (Do keep in mind though that while this library is licensed under the MPL, `net_ws` is licensed under GPLv2.)\n\nYou can also refer to `test.c` which shows how a WebSocket client and server can be used.\n\n## Building\n\nThis library is quite simple and has *no* external dependencies. To build, simply run:\n\n`make`\n\nTo install the shared library, `libwss.so`, run:\n\n`make install`\n\nYou can then link with the library in your project with `-lwss`, as you would expect.\n\nTo build the tests, run `make tests`, and then run `./test` in the source directory.\n\n## FAQ\n\n### Does this library support TLS?\n\nTLS is beyond the scope of this library. To use TLS, you can configure I/O callbacks for read and write operations,\nand then your application can do TLS operations (e.g. `SSL_read` and `SSL_write`, if you are using OpenSSL).\nBecause your application provides the TLS implementation, you can use any TLS library of your choice.\n\nIf no I/O callbacks are configured, the library will try to read and write directly from the file descriptors\nprovided when a client was created.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterlinked1%2Flibwss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterlinked1%2Flibwss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterlinked1%2Flibwss/lists"}