Basic HTTP server
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.travis.yml
Makefile
README.md
TODO.md
minihttp.service

README.md

Alt text

MiniHTTP

A simple webserver that implements a subset of HTTP/1.1. No external libraries are required to compile MiniHTTP and it compiles without warnings with '-Wall' on Raspbian Jessie. This is not to say there are no bugs (far from it). MiniHTTP is an educational project with lots of improvements to be made.

Processes are forked to handle GET or POST requests. Basic CGI support is implemented for GET and POST although only CONTENT_LENGTH and QUERY_STRING environment variables are set as well as sending POST data to stdin. Any *.cgi file is assumed to be executable and MiniHTTP will attempt to fork a process and execute it. In this way php and python CGI scripts are supported as long as their necessary libraries are installed and the script is named accordingly.

This software is free as in free as in do whatever you want with it. The exception of course is http_parser.c and http_parser.h as they are not my works. Find a link to that project below.

Arguments

-p [PORT] Port number
-d [DOCROOT] Directory where files will be served from
-b [BACKLOG] Backlog for accept()
-l [LOGFILE] A path to a FILE that minihttp can write logs to, file will be created if none exists. Logs are of the form "<method>,<requested file>,<GMT time>"
-a run as a daemon

Thanks to:
Beej's Guide to Network Programming
HTTP Parser