Build an HTTPS server without a framework
Building an HTTPS web server from scratch, including routing, signal handling, errors, static files and MIME types.
- Context
- University project
- Role
- Systems design and development in C
- Status
- Completed
Technical trace · 04
- C
- HTTP
- HTTPS
- TLS
- Sockets
- MIME
- Linux
- HTTP request → routing → response
- HTTPS, static files and MIME types
- Explicit error handling and process shutdown
Take control of the foundations of the web.
Challenge
The goal was not to assemble an existing server, but to understand and build the mechanisms connecting a request, a response and a process lifecycle. The server had to respond correctly, remain explicit about errors and shut down cleanly.
Mission
Develop an HTTPS server without a framework or web library, able to route requests, serve files, recognise MIME types and handle signals and errors in a controlled way.
Express the protocol in a readable program.
- 01
Read and qualify the request
Accept the connection, interpret the useful parts of the HTTP request and route each path to an expected response rather than implicit behaviour.
- 02
Serve the right content
Associate static resources with their MIME types so the browser can understand the received content and responses remain consistent.
- 03
Secure the transport
Integrate HTTPS into the response cycle to handle secure exchanges without delegating web logic to a framework.
- 04
Handle edge cases
Handle errors, signals and process shutdown so the server remains controlled when the request or environment is not ideal.
A simple server responsible for every step.
This project made abstractions usually hidden by frameworks tangible: a request is not just a function, and a response depends on the protocol, the system, the process lifecycle and precise error-handling choices. That understanding now informs my full-stack decisions: I know what a tool simplifies and what it should never be asked to hide.
- An HTTPS web server developed from system and network primitives.
- Explicitly controlled routing and static-file serving.
- Support for MIME types and common error cases.
- Signal handling that places the process lifecycle at the heart of the design.