Skip to content

trmaa/vanilla_c_web_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTTP Server

Its a small vanilla C very basic program which lets you host html or whatever file on localhost.

Instalation:

$ git clone https://github.com/trmaa/vanilla_c_web_server.git
$ cd vanilla_c_web_server
$ chmod +x ./scripts/make.sh
$ c -n serve -i include build install # C tool is my own build tool which you can find at my github, if not, run the following commands:
gcc src/*.c -o serve -Iinclude
cp serve /usr/bin/serve

Use:

$ serve -h
Usage: serve [-p port] [-d directory]
Options:
  -h HELP
  -v VERSION
  -p PORT      (default: 8080)
  -d DIR       (default: ./)

Example:

$ serve -d example/
$ firefox http://localhost:8080/index.html

Features to add and flaws:

TODO:

  • It lacks url encoding,
  • file trees for directorys,
  • querys...

FLAWS:

  • It core dumps for no reason some times.

About

Small http server

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages