40%

Complete your profile to find better job opportunities

http_server_C
GitHubRepository

http_server_C

A lightweight, single-threaded HTTP server implemented in pure C that serves static files from a public directory. This project demonstrates fundamental socket programming and HTTP protocol implementation without external dependencies.

  • 1 stars
  • 0 forks
  • C language
View on GitHub
Published
9 Aug 2026
AI summary

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

More work by Pradeep Chetri