Skip to content

Latest commit

 

History

History
106 lines (67 loc) · 2.06 KB

README.md

File metadata and controls

106 lines (67 loc) · 2.06 KB

C++ HTTP Server using Mongoose

A lightweight HTTP server built in C++ using the Mongoose networking library. This project demonstrates how backend servers handle client requests, process them, and return responses efficiently.


Overview

This project explores system-level backend development in C++ by working with an HTTP server architecture. It focuses on understanding request-response flow, networking abstractions, and backend server design.


Tech Stack

  • C++
  • Mongoose (Networking Library)
  • HTTP Protocol
  • Basic Multithreading Concepts

Features

  • Handles HTTP requests and sends responses
  • Implements request parsing and response generation
  • Basic routing for handling endpoints
  • Logging for incoming requests
  • Lightweight and efficient design

How It Works

  1. Server initializes event manager using Mongoose
  2. Listens on a specified port
  3. Receives HTTP requests
  4. Processes requests in handler function
  5. Sends HTTP response back to client

Request Flow

Client → HTTP Request → Server (Mongoose) → Handler Function → Response → Client


Installation & Setup

Clone the repository

git clone https://github.com/YOUR_USERNAME/cpp-multithreaded-http-server.git
cd cpp-multithreaded-http-server

Compile

g++ example.cpp RESTserver/mongoose.c RESTserver/RESTserver.cpp -o server

Run

./server

Usage

Open: http://localhost:8000


Notes

  • Uses Mongoose to abstract low-level socket handling
  • Thread pool implementation exists in the codebase but may require compatible compiler support
  • Focus of this project is understanding HTTP server behavior and request handling

What I Learned

  • How HTTP servers process requests internally
  • Request-response lifecycle
  • Role of networking libraries like Mongoose
  • Basics of concurrency and thread pool design

Future Improvements

  • Enable full thread pool support
  • Enhance routing system
  • Add performance benchmarking
  • Improve concurrency handling

📌 Author

Uppala Shlesha