{"id":26780937,"url":"https://github.com/m4ikz/orpy","last_synced_at":"2025-04-19T11:00:01.017Z","repository":{"id":85280292,"uuid":"604174249","full_name":"M4iKZ/Orpy","owner":"M4iKZ","description":"Orpy HTTP cross platform Server implementation in C++17","archived":false,"fork":false,"pushed_at":"2024-01-13T08:23:02.000Z","size":223,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T03:42:10.597Z","etag":null,"topics":["cpp17","http-server","linux","webserver","windows"],"latest_commit_sha":null,"homepage":"https://orpy.dev","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/M4iKZ.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}},"created_at":"2023-02-20T13:47:08.000Z","updated_at":"2024-01-13T08:22:17.000Z","dependencies_parsed_at":"2023-07-25T23:15:28.735Z","dependency_job_id":"1ebdbf14-b6a3-4150-b7b7-07cded991908","html_url":"https://github.com/M4iKZ/Orpy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M4iKZ%2FOrpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M4iKZ%2FOrpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M4iKZ%2FOrpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/M4iKZ%2FOrpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/M4iKZ","download_url":"https://codeload.github.com/M4iKZ/Orpy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246150417,"owners_count":20731419,"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":["cpp17","http-server","linux","webserver","windows"],"created_at":"2025-03-29T07:19:00.641Z","updated_at":"2025-03-29T07:19:01.066Z","avatar_url":"https://github.com/M4iKZ.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Orpy HTTP Server\n\nImplementation of a HTTP server in C++17 for Windows and Linux.\nUpdated code based on last complete version of Orpy.\n\n## Features\n\n- Handles multiple concurrent connections, tested up to 10k.\n- Supports basic HTTP request and response GET and POST.\n- Provides HTTP/1.1 support with a simple state machine parser.\n- Includes a non-blocking file server.\n\n## Quick start\n\n```bash\nmkdir build \u0026\u0026 cd build\ncmake ..\n```\n\nLinux\n```bash\nmake install\n```\n\nUse Visual Studio 2022 on Windows or Visual Studio Code on Linux.\n\n## Design\n\nThe server program consists of:\n\n- 1 main thread for quit command.\n- 1 listener thread to accept incoming clients.\n- N worker threads to process HTTP requests and sends response back to client based on CPU Threads.\n\n## Config\n\nAt first start Orpy will run a wizard helping to configure all folder and files required.\n\nIf the URL is not specified in the \"Configs/sites/domain.json\" file, the server will respond with a 444 error. \n\nTo set up the server, create a \"Data\" folder where you can place individual folders for each URL.\nCreate a file named \"main.style\" in the \"Data/localhost/style\" directory and add your desired HTML code for content.\n\nThe \"urls\" field in the configuration is used to add or remove parts of the website or allow specific files.\n\nTo create a minimal \"localhost.json\" configuration file for a server to work, you can include the following fields:\n```json\n{\n  \"path\": \"localhost/\",\n  \"urls\": [ \"\", \"myfile.txt\" ]\n}\n```\n\n## Benchmark\n\nI used a tool called [wrk](https://github.com/wg/wrk) to benchmark this HTTP server v1. \n\nMy Specs:\n```bash\nOS: Windows 10 / Ubuntu 22.04 Kernel 6.0.0\nCPU: AMD 2700x 8 Cores / 16 Threads\nGPU: AMD 6900 XT\nMemory: 64 Gb\n```\n\nHere are the results for two test runs. Each test ran for 1 minute, with 10 client threads. The first test had only 500 concurrent connections, while the second test had 10000.\n\n## WINDOWS\n\n```bash\n$ wrk -t10 -c500 -d60s http://localhost:8080\nRunning 1m test @ http://localhost:8080\n  10 threads and 500 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     4.38ms  844.50us  47.08ms   76.27%\n    Req/Sec    11.02k     0.89k   14.56k    74.87%\n  6581408 requests in 1.00m, 1.43GB read\nRequests/sec: 109606.59\nTransfer/sec:     24.36MB\n```\n\n```bash\n$ wrk -t10 -c10000 -d60s http://localhost:8080\nRunning 1m test @ http://localhost:8080\n  10 threads and 10000 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     7.83ms    1.58ms  47.21ms   80.25%\n    Req/Sec    12.25k     3.74k   21.86k    68.19%\n  7302204 requests in 1.00m, 1.58GB read\nRequests/sec: 121515.92\nTransfer/sec:     27.00MB\n```\n\n## Linux\n\n```bash\n$ wrk -t10 -c500 -d60s http://localhost:8080\nRunning 1m test @ http://localhost:8080\n  10 threads and 500 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     1.23ms  598.56us  52.30ms   96.33%\n    Req/Sec    40.94k     3.03k   84.15k    74.20%\n  24449376 requests in 1.00m, 5.31GB read\nRequests/sec: 406961.05\nTransfer/sec:     90.43MB\n```\n\n```bash\n$ wrk -t10 -c10000 -d60s http://localhost:8080\nRunning 1m test @ http://localhost:8080\n  10 threads and 10000 connections\n  Thread Stats   Avg      Stdev     Max   +/- Stdev\n    Latency     2.86ms    0.98ms  41.03ms   89.98%\n    Req/Sec    32.54k    21.26k   94.45k    68.76%\n  19430254 requests in 1.00m, 4.22GB read\nRequests/sec: 323344.07\nTransfer/sec:     71.85MB\n```\n\n## Credits\nOriginal code is inspired by [trungams's http-server](https://github.com/trungams/http-server)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4ikz%2Forpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm4ikz%2Forpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4ikz%2Forpy/lists"}