Authors : Lumi K. / Michale N. / Hoang T.
- Learning Resources: Doc
- Configuration and Routing
- Handles configuration files and routing.
- Reads, interprets, and applies server settings.
- Socket and networking
- Manages networking, sockets, and connections.
- Ensures the server handles multiple clients and keeps connections stable.
- HTTP Processing
- Handles HTTP requests/responses, CGI.
- Ensures the server follows HTTP standards and is extendable.
- Understand the requirements and foundational concepts.
- Design the basic architecture of the server.
- Set up the development environment.
Research (All Members)
- Read
RFC 2616 (HTTP/1.1)to understand HTTP basics and headers. - Study non-blocking I/O concepts (
poll, epoll, kqueue). - Learn from NGINX configuration files.
- Test requests using telnet and basic HTTP GET/POST using curl.
Setup (Member 1)
- Create a Makefile for the project.
- Organize directory structure:
/src, /include, /config, /tests.
Design the Architecture (All Members)
- Draft a flowchart for handling requests and responses.
- Define classes:
Serverfor listening to ports and managing configurations.Connectionfor managing client interactions.RequestandResponsefor parsing and formatting HTTP data.
Configuration File Design (Member 2)
- Draft the structure for the configuration file, inspired by NGINX.
Non-blocking I/O Study (Member 3)
- Prototype a basic poll-based loop to handle multiple connections.
- Implement the core server loop.
- Parse and load configuration files.
- Handle basic HTTP requests.
Server Setup (Member 1)
- Implement the Server class:
- Initialize sockets and bind to ports.
- Configure non-blocking mode.
- Handle multiple clients with poll.
Configuration Parsing (Member 2)
- Implement the configuration file parser:
- Read port, host, and server settings.
- Load routes, error pages, and body size limits.
Basic Request Handling (Member 3)
- Implement the Request class:
- Parse HTTP request headers.
- Handle
GETandPOSTmethods.
Testing and Debugging (All Members)
- Use
telnetto send simple requests and verify responses. - Write basic tests to validate server functionality.
- Add POST and DELETE support.
- Implement error handling and default pages.
- Support file uploads.
Advanced Request Handling (Member 1)
- Implement POST and DELETE methods.
- Handle chunked data in requests.
Error Handling (Member 2)
- Implement a mechanism for generating HTTP status codes and error pages.
File Uploads (Member 3)
- Implement logic to accept and save uploaded files to a specified directory.
- Add CGI execution.
- Implement directory listing and redirection.
- Prepare documentation and test cases.
CGI Support (Member 1)
- Implement logic for executing CGI scripts (e.g., PHP, Python).
Directory Listing and Redirection (Member 2)
- Handle directory listing toggles.
- Implement HTTP redirection rules.
Comprehensive Testing (Member 3)
- Test edge cases, such as invalid requests, large files, and timeout scenarios.
Documentation (All Members)
- Write a user guide and README.
- Document the configuration file format and examples.