alexsikomas/c-http
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
C23 HTTP/1.1 Parser =================== A small C23 project for parsing HTTP/1.1 requests (RFC 9112). It uses Linux-only epoll server to accept connections and respond to requests. Behaviour --------- Current behaviour is intentionally simple: - If a request parses successfully, the server returns 200 OK. - If parsing fails, the server returns 400 Bad Request. - If connection capacity is exhausted, the server returns 503 Service Unavailable. Scope ----- Implemented today: - Request line parsing - Header field parsing and basic validation - Request framing checks for incomplete vs complete messages - Parser result states - Fixed-size header array and basic metadata tracking - Non-blocking, level-triggered epoll loop for connection handling Not implemented: - Routing / endpoint dispatch - Full request body semantics - Cross-platform event loop Platform Notes -------------- This project has been tested on Linux and uses Linux-specific APIs: - epoll - non-blocking sockets via fcntl - typical POSIX networking calls Build ----- Requirements: - CMake >= 4.0 - C compiler with C23 support Init: ./build.sh -i Build & Run: ./build.sh -b Run --- Default sever port is 8000. Run with: ./build.sh -b In another terminal run: curl -v http://localhost:8000 Test ---- ./build.sh -t