https://github.com/sujood-totah/multithreaded-http-server
Multithreaded HTTP server in C using TCP sockets, pthreads, and a thread pool.
https://github.com/sujood-totah/multithreaded-http-server
c computer-networks http-server multithreading networking pthreads socket-programming systems-programming thread-pool
Last synced: 4 days ago
JSON representation
Multithreaded HTTP server in C using TCP sockets, pthreads, and a thread pool.
- Host: GitHub
- URL: https://github.com/sujood-totah/multithreaded-http-server
- Owner: sujood-totah
- Created: 2026-05-19T14:23:15.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2026-05-19T14:31:01.000Z (about 1 month ago)
- Last Synced: 2026-05-19T17:38:59.561Z (about 1 month ago)
- Topics: c, computer-networks, http-server, multithreading, networking, pthreads, socket-programming, systems-programming, thread-pool
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Multithreaded HTTP Server in C
## Project Description
This project implements a simple multithreaded HTTP server in C.
The server accepts client connections over TCP, reads HTTP requests, and sends HTTP responses based on the requested resource.
The project uses a thread pool to handle multiple client requests efficiently.
---
## Features
- TCP socket server
- HTTP request parsing
- Support for GET requests
- Multithreaded request handling
- Thread pool implementation
- Static file serving
- Directory handling
- HTTP error responses
- Connection closing after each response
---
## Files
- `server.c`
- `threadpool.c`
- `threadpool.h`
- `README.md`
- `Makefile`
---
## Compilation
```bash
make
````
Or manually:
```bash
gcc -Wall -pthread -o server server.c threadpool.c
```
---
## Running the Server
```bash
./server
```
Example:
```bash
./server 8080 4 10 100
```
Then open in the browser:
```text
http://localhost:8080/
```
---
## Supported Responses
The server handles common HTTP responses such as:
* `200 OK`
* `302 Found`
* `400 Bad Request`
* `403 Forbidden`
* `404 Not Found`
* `501 Not Supported`
* `500 Internal Server Error`
---
## Concepts Used
* C Programming
* TCP Sockets
* HTTP Protocol
* Multithreading
* pthreads
* Thread Pool
* Synchronization
* File System Handling
---
## Author
Sujood Totah