Skip to content

7eliassen/simpliest_web_server

Repository files navigation

Simple Web Server in C

This is a simple web server implemented in C for Linux. It is designed for educational purposes and should not be used in a production environment.

Features:

  • Processes GET requests

Instalation

git clone https://github.com/7eliassen/simpliest_web_server
cd simpliest_web_server/
make

This program requires the following dependencies:

  • Socket library (socket.h, netinet/in.h, sys/socket.h, arpa/inet.h)

  • Standard library (stdio.h, stdlib.h, string.h, errno.h, unistd.h, fcntl.h, sys/stat.h)

Usage

Transfer your static files to static/. Also you can change 404.html if you want.

Configure redirects in settings/redirects file.

syntax:

settings/redirects:
/:index.html
(from / redirect to /index.html)

To run the web server, use the following command:

./my_web_server [-a (--address) address] [-p (--port) port]

By default, the server listens on 127.0.0.1:6969.

About

simple web server C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published