Skip to content

About

Simple HTTP Web Server is a lightweight implementation of a basic web server designed to serve static HTML pages and handle both HTTP GET and POST requests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🌐 Simple HTTP Web Server

A lightweight HTTP web server built in C++ that serves static HTML pages and handles GET/POST requests.


🧠 Overview

Simple HTTP Web Server is a minimal yet functional web server implemented in C++.
It demonstrates how web servers process HTTP requests and responses, handle client connections, and serve static HTML content.

Developed by Muzzamil (23k-2023) and Zain (23k-2038), this project provides hands-on experience in understanding server-client architecture, HTTP protocols, and web communication.


⚙️ Features

  • 🧩 Serves static HTML pages from the /pages directory
  • 📬 Supports HTTP GET and POST requests
  • 🗂️ Uses users.txt to store form submissions (like registration data)
  • ❌ Custom 404 Error Page for missing routes
  • ⚡ Lightweight & efficient, perfect for learning the basics of web servers

📁 Project Structure

  SimpleHttpServer/
  │
  ├── server.cpp           # Main C++ server code
  ├── users.txt            # Stores user data from forms
  ├── pages/               # Folder containing served web pages
  │   ├── 404.html         # Not found page
  │   ├── info.html        # Info / sample page
  │   ├── login.html       # Login form
  │   ├── register.html    # Registration form
  │   ├── thankyou.html    # Confirmation after form submission
  │   └── style.css        # Common page styling

🚀 Getting Started

🧰 Prerequisites

Make sure you have the following installed:

  • C++ Compiler (e.g., g++, clang++)
  • Terminal or Command Prompt

▶️ Run Instructions

  1. Clone this repository
    git clone https://github.com/<your-username>/SimpleHttpServer.git
    cd SimpleHttpServer
    
  2. Compile the server
    g++ server.cpp -o server
    
    
  3. Run the server
    ./server
    
    
  4. Open in your browser
    http://localhost:8080
    
    
    

🌍 Available Pages

Page Description
login.html User login interface
register.html New user registration page
thankyou.html Confirmation page after registration
info.html General information page
404.html Error page for invalid routes

🧠 Learning Outcomes Through this project, we explored:

-Fundamentals of HTTP protocols (GET/POST) -Basics of web server architecture -How to handle client-server communication -Implementing simple data persistence -Serving static web content using C++

👨‍💻 Contributors

Name Roll No Role
Muzzamil 23k-2023 GET request handling, setup & optimization
Zain 23k-2038 POST handling, HTML integration, testing & debugging

📚 References MDN – HTTP Overview, Flask Docs, Spring Boot Docs, Node.js Docs

About

Simple HTTP Web Server is a lightweight implementation of a basic web server designed to serve static HTML pages and handle both HTTP GET and POST requests.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages