{"id":25953540,"url":"https://github.com/akhaled01/kang","last_synced_at":"2026-02-21T14:33:39.299Z","repository":{"id":280584652,"uuid":"942470019","full_name":"akhaled01/kang","owner":"akhaled01","description":"Kang: the crustaceous HTTP server","archived":false,"fork":false,"pushed_at":"2025-04-22T15:12:37.000Z","size":244,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-18T07:48:35.121Z","etag":null,"topics":["cargo","http","php","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/akhaled01.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"AUDITS.md","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-04T06:42:34.000Z","updated_at":"2025-04-22T15:12:40.000Z","dependencies_parsed_at":"2025-03-04T08:25:05.337Z","dependency_job_id":"fbc63c3c-1e3a-4ec1-84ea-8186b039c61b","html_url":"https://github.com/akhaled01/kang","commit_stats":null,"previous_names":["akhaled01/kang"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akhaled01/kang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhaled01%2Fkang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhaled01%2Fkang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhaled01%2Fkang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhaled01%2Fkang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akhaled01","download_url":"https://codeload.github.com/akhaled01/kang/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhaled01%2Fkang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29683996,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T14:31:22.911Z","status":"ssl_error","status_checked_at":"2026-02-21T14:31:22.570Z","response_time":107,"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":["cargo","http","php","rust"],"created_at":"2025-03-04T15:29:07.988Z","updated_at":"2026-02-21T14:33:39.283Z","avatar_url":"https://github.com/akhaled01.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kang - The crustaceous HTTP server \n\n![Kang_Logo-removebg-preview](https://github.com/user-attachments/assets/8a93db9c-2a76-4f85-a6f4-5811c023d848)\n\nKang is a high-performance HTTP server written in Rust, designed for modern web applications. It uses an event-driven architecture with epoll for efficient I/O handling and supports multiple server configurations similar to Nginx.\n\n\u003e[!CAUTION]\n\u003eThis project is still in very early stages and will undergo continous development. Please do not use for production environments\n\n## Features\n\n- Event-driven architecture using epoll\n- Multiple server configurations\n- Configurable routes and locations\n- CGI support\n- Static file serving\n- Directory listing\n- Custom error pages\n- CORS support\n- Gzip compression\n- Cache control\n\n## Configuration Guide\n\nKang uses a JSON-based configuration file (`kangrc`). Below is a comprehensive guide to all available options.\n\n### Global Configuration\n\n```json\n{\n    \"global\": {\n        \"worker_processes\": 4,                // Required: Number of worker processes\n        \"worker_connections\": 1024,          // Required: Max connections per worker\n        \"pid\": \"/var/run/kang.pid\",         // Optional: PID file location\n        \"log_level\": \"info\",                // Optional: Log level (debug, info, warn, error)\n        \"error_pages\": {                     // Optional: Custom error pages\n            \"root\": \"/path/to/error/pages\",\n            \"404\": \"404.html\",\n            \"403\": \"403.html\",\n            \"500\": \"500.html\"\n        },\n        \"client_max_body_size\": \"10M\"       // Optional: Default max body size\n    }\n}\n```\n\n### Server Configuration\n\nEach server block can have the following options:\n\n```json\n{\n    \"servers\": [{\n        // Required Options\n        \"server_name\": \"example.com\",        // Server name(s)\n        \"host\": \"0.0.0.0\",                  // Binding address\n        \"ports\": [80, 443],                 // Listening ports\n\n        // Optional Options\n        \"is_default\": true,                 // Whether this is the default server\n        \"backlog\": 128,                     // TCP backlog size\n        \"max_connections\": 10000,           // Max concurrent connections\n        \"client_max_body_size\": \"100M\",     // Override global body size limit\n        \n        // SSL/TLS Configuration (Optional)\n        \"ssl\": {\n            \"certificate\": \"/path/to/cert\",\n            \"certificate_key\": \"/path/to/key\",\n            \"protocols\": [\"TLSv1.2\", \"TLSv1.3\"]\n        },\n\n        // Timeouts (Optional)\n        \"timeouts\": {\n            \"read\": 60,                     // Read timeout in seconds\n            \"write\": 60,                    // Write timeout in seconds\n            \"keep_alive\": 75                // Keep-alive timeout in seconds\n        },\n\n        // TCP Options (Optional)\n        \"tcp_options\": {\n            \"tcp_nodelay\": true,\n            \"so_keepalive\": true,\n            \"so_reuseaddr\": true\n        }\n    }]\n}\n```\n\n### Route Configuration\n\nEach server can have multiple routes:\n\n```json\n{\n    \"routes\": [{\n        // Required Options\n        \"path\": \"/\",                        // URL path to match\n        \"root\": \"/var/www/example\",         // Root directory for this route\n\n        // Optional Options\n        \"methods\": [\"GET\", \"POST\"],         // Allowed HTTP methods\n        \"index\": [\"index.html\"],            // Default files for directories\n        \"directory_listing\": false,         // Enable/disable directory listing\n        \"client_max_body_size\": \"50M\",      // Route-specific body size limit\n\n        // Redirection (Optional)\n        \"redirect\": {\n            \"url\": \"/new-path\",\n            \"type\": 301                     // 301 or 302\n        },\n\n        // CGI Configuration (Optional)\n        \"cgi\": {\n            \".php\": \"/usr/bin/php-cgi\",\n            \".py\": \"/usr/bin/python3\"\n        },\n\n        // CORS Settings (Optional)\n        \"cors\": {\n            \"enabled\": true,\n            \"allowed_origins\": [\"*\"],\n            \"allowed_methods\": [\"GET\", \"POST\"],\n            \"allowed_headers\": [\"Content-Type\"],\n            \"max_age\": 3600\n        },\n\n        // Caching (Optional)\n        \"cache_control\": {\n            \"max_age\": 86400,\n            \"public\": true\n        },\n\n        // Compression (Optional)\n        \"gzip\": true,\n        \"gzip_types\": [\"text/plain\", \"text/html\"]\n    }]\n}\n```\n\n### Size Units\n\nFor size configurations (like `client_max_body_size`), the following units are supported:\n- `B` (Bytes)\n- `K` or `KB` (Kilobytes)\n- `M` or `MB` (Megabytes)\n- `G` or `GB` (Gigabytes)\n\nExample: \"10M\", \"1G\", \"500K\"\n\n## Building from Source\n\n```bash\ncargo build --release\n```\n\n## Running Kang\n\n```bash\nkang --config /path/to/kangrc\n```\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhaled01%2Fkang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhaled01%2Fkang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhaled01%2Fkang/lists"}