| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A multi-threaded HTTP/1.1 compliant web server implementation in C++ using Windows Sockets API (Winsock). This server supports multiple simultaneous connections, multi-language content delivery, and full CRUD operations.
Ori Braverman
The server follows a modular architecture with clear separation of concerns:
┌─────────────────────────────────────┐
│ Client Requests │
└─────────────┬───────────────────────┘
│
┌─────────────▼───────────────────────┐
│ Main Server Loop │
│ (server3.cpp) │
│ - Socket Management │
│ - Connection Handling │
│ - Request/Response Coordination │
└─────────────┬───────────────────────┘
│
┌─────────────▼───────────────────────┐
│ Server Utilities │
│ (ServerUtilities.cpp/.h) │
│ - HTTP Method Processing │
│ - File Operations │
│ - Response Generation │
│ - Language Detection │
└─────────────┬───────────────────────┘
│
┌─────────────▼───────────────────────┐
│ Static Content │
│ (HTML_FILES/) │
│ - Multi-language HTML files │
│ - Error pages │
│ - Test content │
└─────────────────────────────────────┘
git clone https://github.com/OriBraverman/HTTP-Web-Server.git
cd HTTP-Web-ServerExtract the HTML_FILES.rar archive to C:\Temp\:
C:\Temp\HTML_FILES\ ├── English\ │ └── index.html ├── French\ │ └── index.html ├── Hebrew\ │ └── index.html ├── Error\ │ └── error.html ├── fileToAdd.txt └── fileToDelete.txt
The server configuration is defined in ServerUtilities.h:
The server expects content to be organized as follows:
C:\Temp\HTML_FILES\ ├── English\ # English content ├── French\ # French content ├── Hebrew\ # Hebrew content └── Error\ # Error pages
Waiting for client to connect to the server.
Retrieves static content from the server.
GET /index.html HTTP/1.1
Host: localhost:27015Sends data to the server for processing.
POST /endpoint HTTP/1.1
Host: localhost:27015
Content-Length: 13
Hello, Server!Creates or updates files on the server.
PUT /newfile.txt HTTP/1.1
Host: localhost:27015
Content-Length: 20
This is new content!Removes files from the server.
DELETE /fileToDelete.txt HTTP/1.1
Host: localhost:27015Returns headers only (no body content).
HEAD /index.html HTTP/1.1
Host: localhost:27015Returns supported HTTP methods.
OPTIONS / HTTP/1.1
Host: localhost:27015Echoes the received request back to the client.
TRACE / HTTP/1.1
Host: localhost:27015The server supports content in multiple languages through query string parameters:
| Language | Query Parameter | Example |
|---|---|---|
| English (default) | lang=en or no parameter | index.html |
| French | lang=fr | index.html?lang=fr |
| Hebrew | lang=he | index.html?lang=he |
The server supports various language code variants:
curl http://localhost:27015/index.htmlcurl -X POST -d "Hello from client!" http://localhost:27015/curl -X PUT -d "New file content" http://localhost:27015/newfile.txtcurl -X DELETE http://localhost:27015/fileToDelete.txtcurl http://localhost:27015/index.html?lang=fr# GET request
Invoke-WebRequest -Uri "http://localhost:27015/index.html"
# POST request
Invoke-WebRequest -Uri "http://localhost:27015/" -Method POST -Body "Hello Server"
# PUT request
Invoke-WebRequest -Uri "http://localhost:27015/test.txt" -Method PUT -Body "Test content"HTTP-Web-Server/
├── README.md # This documentation
├── README.txt # Original brief documentation
├── HTML_FILES.rar # Static content archive
└── Server3/ # Main server implementation
├── Server3.sln # Visual Studio solution
├── Server3.vcxproj # Project file
├── server3.cpp # Main server logic
├── ServerUtilities.h # Server utilities header
└── ServerUtilities.cpp # Server utilities implementation
Error at bind(): 10048
Solution: Ensure port 27015 is not being used by another application.
404 Not Found
Solution: Verify HTML_FILES is extracted to C:\Temp\HTML_FILES\
Solution: Check if the client request is complete and properly formatted.
Solution:
The server provides verbose console output including:
This project is part of an educational implementation. Please respect the original author's work and provide appropriate attribution when using or modifying this code.
For questions or support, please refer to the project repository or contact the author.
| Back | FazBrowse Home | New Git URL |