Skip to content

sandeepsandy62/Httpserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi-threaded HTTP Server in C

A simple yet powerful multi-threaded HTTP server written in C. It demonstrates core networking concepts, threading with pthreads, and serves both HTML and image responses. Logging with timestamps is supported for easy debugging and monitoring.


Features

  • Multi-threaded request handling using pthread
  • HTTP 1.1 compliant basic request parsing
  • Serves HTML content and .webp images
  • Logs all major server events with timestamps
  • Graceful error handling with log messages
  • Supports both IPv4 and IPv6 connections

Requirements

  • GCC (or any C compiler)
  • POSIX-compliant system (Linux/macOS)

Compile

gcc streamserver.c -o streamserver
./streamserver

Test the Server Root Request

curl http://localhost:3490/

You will receive an HTML page listing the server features.

Image Request

curl http://localhost:3490/luffy --output luffy.webp

About

A simple http server implemented in c language

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages