Skip to content

About

A low-level HTTP/1.1 server implementation in C using POSIX on Linux.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTPServerInC

A lightweight HTTP server written in C, built to explore low-level network programming, POSIX sockets and HTTP communication on Linux. It was bulit for educational purposes.

Overview

HTTPServerInC is a project focused on understanding how an HTTP server works internally, from accepting client connections to processing HTTP requests and returning responses. Instead of relying on high-level web framework, this project uses C and system-level networking APIs to explore the fundamentals of client-server communication and HTTP protocol handling.

Getting Started

Prerequisites

Make sure you have the following installed:

  • Linux or compatible POSIX environment;
  • GCC or Clang;
  • CMake;
  • GNU Make or another supported build tool;

1. Clone the repository

git clone https://github.com/AveePB/HTTPServerInC.git
cd HTTPServerInC

2. Build the project

Configure the project using CMake:

cmake -S . -B build

Compile the source code:

cmake --build build

3. Run the server

Launch the executable generated by the build process. The file is in the build directory.

cd build
./HTTPServer

Running Tests

The repository includes a test script located at assets/run_40_tests.sh.

1. Grant execution permissions

From the repository root, run:

chmod +x assets/run_40_tests.sh

2. Run the test suite

Execute the script and save both standard output and error output to a results file:

cd assets
./run_40_tests.sh > test_results.txt

3. View the test results

After the tests finish, inspect the output:

cat test_results.txt

Acknowledgements

Special thanks to Beej's Guide to Network Programming for its clear explanations of networking concepts, sockets, and low-level network programming in C.

Additional thanks to Jacob Sorber for his educational videos and tutorials on C programming, operating systems, and systems-level concepts, which helped deepen my understanding throughout this project.

Their educational resources were invaluable in learning and exploring the fundamentals of building an HTTP server from scratch.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

A low-level HTTP/1.1 server implementation in C using POSIX on Linux.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages