Skip to content

EmmmaTech/tiny-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tiny http server

a little http server written completely in c, with the stdlib and bsd sockets!

my old draft can be found here, if so desired.

features

  • supports most requests made with HTTP/1.1 (except for CONNECT)
  • supports concurrent connections via multithreading
  • handles http error responses
  • supports custom handlers to process requests
  • tls support via openssl (off by default)
  • serves text & binary files (see mimetype.c for supported mimetypes)

usage

./build/httpsrv servedir [config]

any file located in the servedir will automatically be served by the file. any / path will automatically relocate to index.html.

the config file is by default located at ./config.conf. an example config file can be found on this repo.

handlers for http routes can be written using the HANDLER_FUNC & HANDLER macros. there is an example located in the src/main.c file.

About

a little http server written completely in c, with the stdlib and bsd sockets!

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages