Skip to content

NatanR-dev/webserver-in-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Webserver in C

A Minimal HTTP server in C.

  • Outputs a JSON response on port 8080.
  • Uses sockets (sys/socket.h, netinet/in.h).
  • Sends the JSON response.
  • Accepts HTML client connections in a loop.
    • Returns (ok) --> HTTP 200 status code.

Index

Quick Start

Windows

Environment:

  1. Install Chocolatey: choco install
  2. Install MinGW: choco install mingw
  3. Add MinGW to PATH: C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin

Compile:

gcc  webserver.c -o webserver -lws2_32

Run:

.\webserver.exe

Ubuntu

Environment:

  1. Install GCC: sudo apt update && sudo apt install build-essential

Compile:

gcc  webserver.c -o webserver

Run:

./webserver

macOS

Environment:

  1. Install Homebrew: brew install
  2. Install GCC: brew install gcc

Compile:

gcc  webserver.c -o webserver

Run:

./webserver

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published