Skip to content

This is a multithreaded server that I built. Connecting through netcat or localhost a user can use GET to request different kinds of files and the server will respond with a header and the file content. The headers include status codes (ex 200, 404, 400...), content length, and content type.

Notifications You must be signed in to change notification settings

lhaase3/GET_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Multithreaded TCP Server

This is a simple multithreaded TCP server written in C that handles HTTP GET requests.
It serves static files from the www/ directory and supports basic error handling.


Features

✅ Handles multiple clients concurrently using pthread
✅ Supports GET requests (no POST support)
✅ Implements basic HTTP/1.0 and HTTP/1.1
MIME type detection for serving different file types
Graceful shutdown with Ctrl+C (SIGINT)
Timeout handling for inactive clients


Compilation

To compile the server, use:

gcc server.c -o server -lpthread -g

About

This is a multithreaded server that I built. Connecting through netcat or localhost a user can use GET to request different kinds of files and the server will respond with a header and the file content. The headers include status codes (ex 200, 404, 400...), content length, and content type.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published