https://github.com/luc-wallace/rack
A primitive HTTP server implemented in C.
https://github.com/luc-wallace/rack
c http sockets
Last synced: about 2 months ago
JSON representation
A primitive HTTP server implemented in C.
- Host: GitHub
- URL: https://github.com/luc-wallace/rack
- Owner: luc-wallace
- License: mit
- Created: 2025-01-21T22:52:56.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-15T21:35:18.000Z (3 months ago)
- Last Synced: 2025-02-15T22:25:42.501Z (3 months ago)
- Topics: c, http, sockets
- Language: C
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rack
A fast, single-threaded HTTP server implemented in C.
Currently very primitive.
Planned features:
- Response pipeline
- Routing with paths/methods
- JSON?# Why?
Because I wanted to learn how networking and concurrency works at a low level using
system calls. I also just wanted to work on a project in C to improve my skills.# Usage
Build the project by creating a build directory in the root folder and running:
```
cmake ..
```Then, compile the project using:
```
cmake --build .
```# Benchmarks
ApacheBench (5000 requests):
```
Server Software: rack/1.0
Server Hostname: localhost
Server Port: 80Document Path: /
Document Length: 47 bytesConcurrency Level: 500
Time taken for tests: 0.178 seconds
Complete requests: 5000
Failed requests: 0
Total transferred: 915000 bytes
HTML transferred: 235000 bytes
Requests per second: 28161.40 [#/sec] (mean)
Time per request: 17.755 [ms] (mean)
Time per request: 0.036 [ms] (mean, across all concurrent requests)
Transfer rate: 5032.75 [Kbytes/sec] received
```