Implementing an HTTP Server for my final project for ENPM818M: Introduction to Networking and Distributed Systems 5G/6G.
The HTTP Server will be built using C++
- HTTP Server can handle requests from an HTTP Client and returns a 200 response.
- HTTP Server can route HTTP Client requests to certain endpoints and return endpoint specific information.
- HTTP Server can handle GET requests and return server information.
- HTTP Server can handle POST requests by updating a “database” file on the server side.
- HTTP Server can handle PUT requests by updating a “database” file on the server side.
- HTTP Server can handle DELETE requests by updating a “database” file on the server side.
- HTTP Server can handle different headers sent in the HTTP Client request.
- HTTP Server implements error handling: 400 Error
- HTTP Server implements error handling: 404 Error
- HTTP Server implements error handling: 500 Error
- GET /
- GET /about
- GET /students
- Requires
User-Role: Viewer or Adminheader
- Requires
- GET /student/<email>
- Requires
User-Role: Viewer or Adminheader
- Requires
- DELETE /student/<email>
- Requires
User-Role: Adminheader
- Requires
- POST /student
- Requires
User-Role: Adminheader - Add email, name, and course as data fields
- Requires
- PUT /student
- Requires
User-Role: Adminheader - Add email, name, and course as data fields
- Requires
To build and run the project, follow these steps:
-
Create a build directory and navigate into it:
mkdir build && cd build
-
Generate the build files using CMake:
cmake ..
-
Build the executable file:
make
-
Run the executable file:
./http_server
Make sure the executable is run from the same directory
Use the curl.sh file to make requests to the server.
The Wireshark .pcap files are in the wireshark/ directory. Filter them for HTTP traffic.