| Role | Name | | All | Sherie Longcob |
| Lead Coder | [Sherie Longcob - Lead Person and Documenter] |
This server was built to demonstrate fundamental socket programming in C, specifically handling simple HTTP GET requests and responding with 200 OK or 400 Bad Request status codes, compiled using MinGW and the Winsock API.
- GCC/MinGW: Installed and configured in the system PATH
(verified with
gcc --version). - Git: Installed for version control.
- Terminal/Command Prompt: Ready to use.
- Navigate to the repository folder:
cd Act1_HTTP_Server- Compile the
server.cfile. The-lws2_32flag is crucial for linking the Winsock library on Windows:
gcc server.c -o http_server.exe -lws2_32- Execute the compiled program:
./http_server.exeThe console will display: Server listening on port 8080...
The server is designed to test two scenarios:
- Action: Open a web browser (Chrome, Firefox, etc.) and go to:
http://127.0.0.1:8080 - Result: The server should log the GET request, and the browser should display the "Success!" HTML body.
- Action: Use a terminal tool like
curlto send an unsupported method (e.g., POST):
curl -i -X POST [http://127.0.0.1:8080](http://127.0.0.1:8080)- Result: The server should log the POST request, and the terminal
should show the
HTTP/1.1 400 Bad Requestresponse header

