{"id":16962547,"url":"https://github.com/threeal/simple-web","last_synced_at":"2025-03-21T16:22:24.528Z","repository":{"id":77374706,"uuid":"261015812","full_name":"threeal/Simple-Web","owner":"threeal","description":"A simple HTTP, HTTPS, WS and WSS server and client library","archived":false,"fork":false,"pushed_at":"2020-05-05T19:40:32.000Z","size":77,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T11:42:23.753Z","etag":null,"topics":["http","http-client","http-library","http-server","https","websocket","websocket-library"],"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/threeal.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":"2020-05-03T20:33:24.000Z","updated_at":"2024-09-14T05:18:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"cdcea951-2619-4f7a-aa8c-552af1c66c62","html_url":"https://github.com/threeal/Simple-Web","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/threeal%2FSimple-Web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2FSimple-Web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2FSimple-Web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/threeal%2FSimple-Web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/threeal","download_url":"https://codeload.github.com/threeal/Simple-Web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244826024,"owners_count":20516669,"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":["http","http-client","http-library","http-server","https","websocket","websocket-library"],"created_at":"2024-10-13T23:07:05.812Z","updated_at":"2025-03-21T16:22:24.519Z","avatar_url":"https://github.com/threeal.png","language":"C++","readme":"# Simple Web\n\nA very simple, fast, multithreaded, platform independent HTTP, HTTPS, WebSocket (WS) and WebSocket Secure (WSS) server and client library implemented using C++11 and Asio (both Boost.Asio and standalone Asio can be used). Created to be an easy way to make REST resources and WebSocket endpoints available from C++ applications.\n\nThis project was created from the merge of [Simple Web Server](https://gitlab.com/eidheim/Simple-Web-Server) (version 3.0.2) and [Simple Websocket Server](https://gitlab.com/eidheim/Simple-WebSocket-Server) (version 2.0.0) as a single library to simplify the deploying of it on the Debian operating system.\n\n## Features\n\n* Asynchronous request and message handling\n* Thread pool if needed\n* Platform independent\n* HTTP/1.1 supported, including persistent connections\n* HTTPS supported\n* WebSocket Secure support\n* Chunked transfer encoding and server-sent events\n* Can set timeouts for request/response and content\n* Can set max request/response size\n* Sending outgoing messages is thread safe\n* Client creates necessary connections and perform reconnects when needed\n* RFC 6455 mostly supported: text/binary frames, fragmented messages, ping-pong, connection close with status and reason.\n* Timeouts, if any of SocketServer::timeout_request and SocketServer::timeout_idle are \u003e0 (default: SocketServer::timeout_request=5 seconds, and SocketServer::timeout_idle=0 seconds; no timeout on idle connections)\n* Simple way to add WebSocket endpoints using regex for path, and anonymous functions\n* An easy to use WebSocket and WebSocket Secure client library\n* C++ bindings to the following OpenSSL methods: Base64, MD5, SHA1, SHA256 and SHA512 (found in crypto.hpp)\n\n## Dependencies\n\n* Boost.Asio or standalone Asio\n* OpenSSL libraries\n\n## Updating the Library\n\n- Clone and checkout both `Simple Web Server` and `Simple Websocket Server` to the latest release.\n- Merge both header files (`*.hpp`) of the library and put it under `include/simpleweb` directory.\n  \u003e **Note**: both library could contains the same header files.\n  \u003e Make sure to checkout the repository on version that make both library contains the same header version, else you need to fix the conflict manually.\n- Rename some header files as follow:\n  - rename `client_http.hpp` to `http_client.hpp`.\n  - rename `client_https.hpp` to `https_client.hpp`.\n  - rename `client_ws.hpp` to `ws_client.hpp`.\n  - rename `client_wss.hpp` to `wss_client.hpp`.\n  - rename `server_http.hpp` to `http_server.hpp`.\n  - rename `server_https.hpp` to `https_server.hpp`.\n  - rename `server_ws.hpp` to `ws_server.hpp`.\n  - rename `server_wss.hpp` to `wss_server.hpp`.\n  \u003e **Note**: don't forget to fix the `#include` definition and the header guard for each source files and header files to match the new header path.\n  \u003e _(Example: change from `#include \"client_http.hpp\"` to `#include \"simple_web/http_client.hpp\"`)_\n- Put example files including the html examples of both library under `examples` directory.\n- For every source files and header files in this project, make the following changes:\n  - Rename some macro definitions as follow:\n    - change `USE_STANDALONE_ASIO` to `SIMPLEWEB_USE_STANDALONE_ASIO`.\n    - change `HAVE_OPENSSL` to `SIMPLEWEB_USE_STANDALONE_ASIO`.\n    - change `HAVE_OPENSSL` to `SIMPLEWEB_USE_OPENSSL`.\n  - Add some namespaces as follow:\n    - add `SimpleWeb::HttpServer = SimpleWeb::SocketServer\u003cSimpleWeb::HTTP\u003e` inside `simpleweb/server_http.hpp`.\n    - add `SimpleWeb::HttpClient = SimpleWeb::SocketClient\u003cSimpleWeb::HTTP\u003e` inside `simpleweb/client_http.hpp`.\n    - add `SimpleWeb::HttpsServer = SimpleWeb::SocketServer\u003cSimpleWeb::HTTPS\u003e` inside `simpleweb/server_https.hpp`.\n    - add `SimpleWeb::HttpsClient = SimpleWeb::SocketClient\u003cSimpleWeb::HTTPS\u003e` inside `simpleweb/client_https.hpp`.\n    - add `SimpleWeb::WsServer = SimpleWeb::SocketServer\u003cSimpleWeb::WS\u003e` inside `simpleweb/server_ws.hpp`.\n    - add `SimpleWeb::WsClient = SimpleWeb::SocketClient\u003cSimpleWeb::WS\u003e` inside `simpleweb/client_ws.hpp`.\n    - add `SimpleWeb::WssServer = SimpleWeb::SocketServer\u003cSimpleWeb::WSS\u003e` inside `simpleweb/server_wss.hpp`.\n    - add `SimpleWeb::WssClient = SimpleWeb::SocketClient\u003cSimpleWeb::WSS\u003e` inside `simpleweb/client_wss.hpp`.\n\n## Building the Debian Package\n\n- Create a `build` directory and move to it.\n  ```bash\n  $ mkdir build\n  $ cd build\n  ```\n- Configure the Makefile rules  with `/usr` as the install prefix.\n  ```bash\n  $ cmake -DCMAKE_INSTALL_PREFIX=/usr ..\n  ```\n- Build the library.\n  ```bash\n  $ make\n  ```\n  \u003e Note: you could speed up the build process with specifying the job count parameter using `-jn` where `n` is number of the jobs. _(example: `$ make -j4`)_\n- Create debian package using cpack.\n  ```bash\n  $ cpack\n  ```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fsimple-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthreeal%2Fsimple-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthreeal%2Fsimple-web/lists"}