{"id":24105091,"url":"https://github.com/servettonga/cpp_webserv","last_synced_at":"2026-02-08T16:31:57.275Z","repository":{"id":271467523,"uuid":"867166634","full_name":"servettonga/cpp_webserv","owner":"servettonga","description":"A lightweight HTTP/1.1 compliant web server supporting static file serving, CGI execution, and virtual hosts.","archived":false,"fork":false,"pushed_at":"2025-01-08T09:47:38.000Z","size":43952,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T12:38:49.387Z","etag":null,"topics":["cpp","cpp98","http","http-server","nginx","websocket"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/servettonga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-03T15:06:31.000Z","updated_at":"2025-01-08T09:47:41.000Z","dependencies_parsed_at":"2025-01-08T00:27:57.771Z","dependency_job_id":null,"html_url":"https://github.com/servettonga/cpp_webserv","commit_stats":null,"previous_names":["servettonga/cpp_webserv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/servettonga/cpp_webserv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servettonga%2Fcpp_webserv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servettonga%2Fcpp_webserv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servettonga%2Fcpp_webserv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servettonga%2Fcpp_webserv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/servettonga","download_url":"https://codeload.github.com/servettonga/cpp_webserv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/servettonga%2Fcpp_webserv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29236898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T14:18:14.570Z","status":"ssl_error","status_checked_at":"2026-02-08T14:18:14.071Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","cpp98","http","http-server","nginx","websocket"],"created_at":"2025-01-10T20:25:24.555Z","updated_at":"2026-02-08T16:31:57.255Z","avatar_url":"https://github.com/servettonga.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# A HTTP server in C++98\n\nA lightweight HTTP/1.1 compliant web server supporting static file serving, CGI execution, and virtual hosts.\n\n## Features\n\n- **HTTP/1.1 Compliance**\n  - `GET`, `POST`, `DELETE` methods\n  - Keep-alive connections\n  - Status codes per RFC standards\n\n- **Core Functionality**\n  - Static file serving\n  - Directory listing\n  - File uploads\n  - CGI execution\n  - Virtual host support\n\n- **Performance**\n  - Non-blocking I/O\n  - Single `select()` multiplexing\n  - Connection pooling\n  - Memory-efficient design\n\n- **Configuration**\n  - Multiple port binding\n  - Custom error pages\n  - Route-based rules\n  - Directory restrictions\n  - Upload size limits\n\n## Architecture\n\n```mermaid\nsequenceDiagram\n    participant Client\n    participant Listener as Server Listener\n    participant Poller as Polling Mechanism\n    participant Handler as Request Handler\n    participant Router\n    participant Methods as HTTP Methods\n    participant Static as Static File Server\n    participant CGI as CGI Handler\n    participant Error as Error Handler\n    participant Response as Response Generator\n\n    Client-\u003e\u003eListener: Connect to Server\n    Listener-\u003e\u003ePoller: Register Socket\n    Poller--\u003e\u003eListener: Socket Ready\n    Listener-\u003e\u003eHandler: Accept Connection\n    Handler-\u003e\u003ePoller: Register Client Socket\n    Poller--\u003e\u003eHandler: Data Ready\n    Handler-\u003e\u003eClient: Read HTTP Request\n    Handler-\u003e\u003eRouter: Parse Request\n    Router-\u003e\u003eRouter: Match Route\n    alt Request Type\n        opt Static Content\n            Router-\u003e\u003eStatic: Retrieve File\n            Static--\u003e\u003eHandler: Serve File\n        end\n        opt Execute CGI\n            Router-\u003e\u003eCGI: Run Script\n            CGI--\u003e\u003eHandler: CGI Output\n        end\n        opt Unsupported Method\n            Router-\u003e\u003eError: Generate Error\n            Error--\u003e\u003eHandler: Error Response\n        end\n    end\n    Handler-\u003e\u003eResponse: Generate HTTP Response\n    Response-\u003e\u003eClient: Send Response\n    Client--\u003e\u003eHandler: Acknowledgment\n    Handler-\u003e\u003ePoller: Remove Socket if Done\n```\n\n## Preview\n\n![preview](https://github.com/user-attachments/assets/3374181a-a4fc-4380-b3a4-80c0b25513f7)\n\n## Quick Start\n\n```bash\n# Build the server\nmake\n\n# Run with default config\n./webserv config/default.conf\n\n# Test basic functionality\ncurl http://localhost:8080/\n```\n\n## Configuration Example\n\n```nginx\nserver {\n    port 8080;\n    server_name localhost;\n    root /var/www;\n\n    location / {\n      index index.html;\n      methods GET POST;\n    }\n\n    location /cgi-bin {\n      allowed_methods GET POST;\n      client_max_body_size 10M;\n      cgi_pass /usr/bin/python3;\n    }\n}\n```\n\n## Requirements\n\n- C++98 compiler\n- POSIX-compliant system\n- CMake 3.0+ (for building)\n\n## `siege` stress test\n\n```bash\n\u003e siege -b 127.0.0.1:8080/empty.html -t10s\n# macOS\nTransactions:               136047 hits\nAvailability:               100.00 %\nElapsed time:               10.76 secs\nData transferred:           0.00 MB\nResponse time:              1.97 ms\nTransaction rate:           12643.77 trans/sec\nThroughput:                 0.00 MB/sec\nConcurrency:                24.89\nSuccessful transactions:    136047\nFailed transactions:        0\nLongest transaction:        30.00 ms\nShortest transaction:       0.00 ms\n# ubuntu\nTransactions:               94641 hits\nAvailability:               100.00 %\nElapsed time:               9.56 secs\nData transferred:           0.00 MB\nResponse time:              0.00 ms\nTransaction rate:           9899.69 trans/sec\nThroughput:                 0.00 MB/sec\nConcurrency:                24.61\nSuccessful transactions:    94641,\nFailed transactions:        0\nLongest transaction:        0.01 ms\nShortest transaction:       0.00 ms\n```\n\n---\n\nThis project is part of the 42 school curriculum.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservettonga%2Fcpp_webserv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fservettonga%2Fcpp_webserv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservettonga%2Fcpp_webserv/lists"}