Skip to content

a very small http server, might have performance and security issues, don't use in production

Notifications You must be signed in to change notification settings

gasp/micro_httpd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The tinyest http server

this tiny http server needs systemd to run (available in most linux distros) it listens for input socket connections and returns html pages

usage

compile

gcc micro_httpd.c -o micro_httpd

place into binary

as root

mv micro_httpd /usr/sbin/micro_httpd

enable as a service

as root

cp micro_httpd.s{ocket,ervice} /etc/systemd/system/
ln -s /etc/systemd/system/micro_httpd.socket /etc/systemd/system/sockets.target.wants/micro_httpd.socket
systemctl start micro_httpd.socket
systemctl status micro_httpd.socket

test

echo "GET / HTTP/1.1" | /usr/sbin/micro_httpd /home/gaspard/www/

uninstall

as root

rm /etc/systemd/system/sockets.target.wants/micro_httpd.socket \
  /etc/systemd/system/micro_httpd.s* \
  /usr/sbin/micro_httpd

debug

as root

systemctl status micro_httpd.socket
systemctl status micro_httpd.service

About

a very small http server, might have performance and security issues, don't use in production

Resources

Stars

Watchers

Forks

Languages