{"id":28456228,"url":"https://github.com/jain1shh/http-server","last_synced_at":"2026-05-16T08:38:34.985Z","repository":{"id":262623948,"uuid":"887845994","full_name":"Jain1shh/Http-Server","owner":"Jain1shh","description":"This repository contains code of single \u0026 multi threaded Http server and client. And also implemented threadpool in server reducing overhead and preventing excessive resource usage.","archived":false,"fork":false,"pushed_at":"2025-02-18T05:13:49.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-29T10:39:46.861Z","etag":null,"topics":["http-server","java","multithreading","socket-programming","threadpool"],"latest_commit_sha":null,"homepage":"https://jain1shh.github.io/What-Jain1shh-Says/blogs/how-real-time-http-servers-handle-client-requests-a-concurrency-engineering-deep-dive.html","language":"Java","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/Jain1shh.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,"zenodo":null}},"created_at":"2024-11-13T11:40:35.000Z","updated_at":"2025-05-28T08:14:02.000Z","dependencies_parsed_at":"2024-11-13T12:33:19.661Z","dependency_job_id":"e6dc8fdb-1d66-46f1-ad64-9a5b6b096c2c","html_url":"https://github.com/Jain1shh/Http-Server","commit_stats":null,"previous_names":["jainish-prajapati/http-server","jain1shh/http-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jain1shh/Http-Server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jain1shh%2FHttp-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jain1shh%2FHttp-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jain1shh%2FHttp-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jain1shh%2FHttp-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jain1shh","download_url":"https://codeload.github.com/Jain1shh/Http-Server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jain1shh%2FHttp-Server/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267866526,"owners_count":24157346,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["http-server","java","multithreading","socket-programming","threadpool"],"created_at":"2025-06-06T23:02:19.120Z","updated_at":"2026-05-16T08:38:34.947Z","avatar_url":"https://github.com/Jain1shh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Http-Server\n\nThis repository contains implementations of a simple HTTP server in Java with three different concurrency models: SingleThreaded, MultiThreaded, and ThreadPool.\n\n## Directory Structure\n\n- `MultiThreaded`\n  - `Server.java`\n  - `Client.java`\n- `SingleThreaded`\n  - `Server.java`\n  - `Client.java`\n- `ThreadPool`\n  - `Server.java`\n\n## Concurrency Models\n\nThis project demonstrates three different approaches to handling multiple client requests concurrently in a server:\n\n1. **SingleThreaded**:  \n   In the single-threaded model, the server processes one client request at a time. This is simple to implement but can only handle one request concurrently, making it less suitable for real-time or high-traffic applications.\n\n2. **MultiThreaded**:  \n   In the multi-threaded model, the server creates a new thread for each client request. This allows multiple clients to be served simultaneously, providing better concurrency than the single-threaded model. However, creating a new thread for each request can become inefficient and resource-intensive under heavy load.\n\n3. **ThreadPool**:  \n   In the thread pool model, the server maintains a fixed number of reusable threads in a pool. When a client request is received, it is assigned to an available thread from the pool. This approach is more efficient than spawning new threads for each request, especially for applications with fluctuating or high request volumes, as it controls the number of active threads.\n\n\n\n## Prerequisites\n\nEnsure you have Java Development Kit (JDK) version 17 installed. If not, install it using the following commands:\n\nFor debian based distros\n```bash\nsudo apt-get update\nsudo apt-get install openjdk-17-jdk\n```\n\nFor Arch\n```bash\nsudo pacman -Syu\nsudo pacman -S jdk21-openjdk\n```\n## Clone Repository\n\nTo clone this repository, open your terminal and run:\n\n```bash\ngit clone https://github.com/Jainish-Prajapati/Http-Server.git\ncd Http-Server\n```\n\n## Running the Servers and Clients\n\nEach concurrency model has its own directory with server and client files. Follow these steps to compile and run the code for each model.\n\nEg. of Multithreaded\n\n```bash\n/*navigate to directory*/\ncd MultiThreaded\n/*Compile files*/\njavac Server.java\njavac Client.java\n```\n\nand similarly you can compile and run single threaded and threadpool servers too.\n\nIt's just an implementation of simple http server, developed to understand exactly how servers works internally irl !!  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjain1shh%2Fhttp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjain1shh%2Fhttp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjain1shh%2Fhttp-server/lists"}