A minimal, single-threaded HTTP server implemented in pure C for Linux using raw POSIX sockets. It serves static files from the public/ directory, supports GET requests, and includes MIME type detection, custom error pages, and request logging.
From the README
http-server A minimal, single-threaded HTTP server written from scratch in C for Linux. Built with raw POSIX sockets — no external libraries, no frameworks. Just gcc and the standard library. It serves static files from the public/ directory over HTTP/1.1. Features • Serves static files from public/ • GET requests only (405 Method Not Allowed for anything else) • MIME type detection (currently HTML and plain text) • Custom 404 error page • Query string stripping (/page?foo=bar → /page) • Request logging with client IP, port, status code, and bytes sent • Socket reuse via SOREUSEADDR for quick restarts • 400 Bad Request handling for malformed request lines Getting Started Requirements •...
Skills
- C
- HTML
- c
- http
- http-client
- http-server
- router
- server
- socket
- socket-client
- socket-server