- Create socket
- Bind to port
- Listen for connections
- Accept connections
- handle socket cleanup
- signal handling for graceful shutdown
- Parse HTTP methods (GET/POST)
- Extract request path
- Basic request logging
- Complete POST handling
- Parse query parameters
- Parse request headers
- Shift to sending inlined html (in the asm) to prevent issue of missing html files
- Send basic HTTP status codes:
- 200 OK
- 404 Not Found
- 403 Forbidden
- 500 Server Error
- Include some headers:
- Content-Type (basic)
- Content-Length
- Connection
- Send response body
- Read static files
- Basic directory structure (/www)
- Default file (index.html)
- Handle file not found
- Complete MIME type detection
- Basic directory security
- Validate request paths
- Prevent directory traversal
- Character validation
- Path whitelist
- Basic input validation
- Structured logging (INFO/ERROR/DEBUG)
- Handle socket errors
- Handle file system errors
- Process forking errors
- Connection handling errors
- Fork for each connection
- Child process cleanup
- Parent process continuation
- Signal handling
- Multiple concurrent connections
- Keep-alive connections
- Request/response compression
- Virtual hosting
- HTTPS support
https://www.reddit.com/r/C_Programming/comments/kbfa6t/building_a_http_server_in_c/ https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500