{"id":15394928,"url":"https://github.com/kassane/standalone-server","last_synced_at":"2025-04-15T23:53:47.092Z","repository":{"id":169427497,"uuid":"645340063","full_name":"kassane/Standalone-Server","owner":"kassane","description":"Asio standalone C++ HTTP/S Server (uses zig build-system)","archived":false,"fork":false,"pushed_at":"2025-03-10T18:16:02.000Z","size":6712,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"zig-pkg","last_synced_at":"2025-03-29T03:04:48.967Z","etag":null,"topics":["cpp","zig-package"],"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/kassane.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-05-25T12:42:07.000Z","updated_at":"2025-03-10T18:16:05.000Z","dependencies_parsed_at":"2024-01-27T09:39:00.447Z","dependency_job_id":"bf59299b-1b39-4d59-8b8f-b55e5b84bfb1","html_url":"https://github.com/kassane/Standalone-Server","commit_stats":null,"previous_names":["kassane/standalone-server"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FStandalone-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FStandalone-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FStandalone-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kassane%2FStandalone-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kassane","download_url":"https://codeload.github.com/kassane/Standalone-Server/tar.gz/refs/heads/zig-pkg","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["cpp","zig-package"],"created_at":"2024-10-01T15:24:58.292Z","updated_at":"2025-04-15T23:53:47.086Z","avatar_url":"https://github.com/kassane.png","language":"C++","readme":"# Standalone-Server\n\nA very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++17 and Asio standalone. Created to be an easy way to make REST resources available from C++ applications.\n\n## Requires\n\n- [Zig](https://ziglang.org/download) toolchain v0.14.0 or master\n\n## Features\n\n* Asynchronous request handling\n* Thread pool if needed\n* Platform independent\n* HTTP/1.1 supported, including persistent connections\n* HTTPS supported\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\n## Usage\n\nSee:\n[http_examples.cpp](examples/http_examples.cpp)\nor\n[https_examples.cpp](examples/https_examples.cpp) for example usage.\nThe following server resources are setup using regular expressions to match request paths:\n* `POST /string` - responds with the posted string.\n* `POST /json` - parses the request content as JSON, and responds with some of the parsed values.\n* `GET /info` - responds with information extracted from the request.\n* `GET /match/([0-9]+)` - matches for instance `/match/123` and responds with the matched number `123`.\n* `GET /work` - starts a thread, simulating heavy work, and responds when the work is done.\n* `GET` - a special default_resource handler is called when a request path does not match any of the above resources.\nThis resource responds with the content of files in the `web/`-folder if the request path identifies one of these files.\n\n## Dependencies\n\n* standalone Asio\n* For HTTPS: OpenSSL libraries\n\nInstallation instructions for the dependencies needed to compile the examples on a selection of platforms can be seen below.\nDefault build with standalone Asio is assumed.\n\n### Debian based distributions\n\n```sh\nsudo apt-get install libssl-dev\n```\n\n### Arch Linux based distributions\n\n```sh\nsudo pacman -S openssl\n```\n\n### MacOS\n\n```sh\nbrew install openssl\n```\n\n## Compile and run\n\n\nChoose **Release_Type** = (ReleaseSafe|ReleaseFast|ReleaseSmall)\n\nCompile with a C++17 compliant compiler (like `zig c++` eql to `clang++ -stdlib=libc++ -fuse-ld=lld`):\n```sh\nzig build -Doptimize={Release_type}\n```\n\n### HTTP\n\nRun the server and client examples: `zig build http_examples -Doptimize=ReleaseSafe`\n\nDirect your favorite browser to for instance http://localhost:8080/\n\n### HTTPS\n\nBefore running the server, an RSA private key (server.key) and an SSL certificate (server.crt) must be created.\n\nRun the server and client examples: `zig build https_examples -Doptimize=ReleaseSafe`\n\nDirect your favorite browser to for instance https://localhost:8080/\n\n## Contributing\n\nContributions are welcome, either by creating an issue or a merge request.\nHowever, before you create a new issue or merge request, please search for previous similar issues or requests.\nA response will normally be given within a few days.\n\n\n## Acknowledgments\n\nMain author: [Ole Christian Eidheim](https://github.com/eidheim) - original project [Simple-Web-Server - Gitlab](https://gitlab.com/eidheim/Simple-Web-Server)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fstandalone-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkassane%2Fstandalone-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkassane%2Fstandalone-server/lists"}