A simple HTTP server built from scratch in C using low-level socket programming.
- Handles basic HTTP requests
- Supports simple routing:
/β Home/sobreβ About page
- Returns plain text responses
- Built using POSIX sockets (
socket,bind,listen,accept) - Minimal and easy to understand
gcc server.c -o server./serverhttp://localhost:8080
| Route | Method | Description |
|---|---|---|
/ |
GET | Home page |
/sobre |
GET | About page |
This server:
- Creates a socket using TCP
- Binds it to port
8080 - Listens for incoming connections
- Accepts client requests
- Reads raw HTTP requests
- Parses routes using simple string matching
- Sends HTTP responses manually
GET / HTTP/1.1
Host: localhost:8080HTTP/1.1 200 OK
Content-Type: text/plain
PΓ‘gina inicial- No concurrency (handles one client at a time)
- Basic request parsing (
strstr) - No support for POST/PUT yet
- No file serving
- Not production-ready
- JSON responses
- Better HTTP parsing
- Support for POST requests
- Multithreading
- Static file serving
- Routing system
This project was built to understand:
- How HTTP works under the hood
- Socket programming in C
- Client-server communication
- Manual request/response handling
Igor Oliveira