Skip to content

rk234/c-http

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C-HTTP

A simple, zero-dependency, concurrent and extensible HTTP server written in C for Linux.

May not be fully standards compliant! This is mainly meant as a learning exercise.

Registering route handlers

C-HTTP supports registering custom route handlers as follows:

server_add_handler(&server, "GET", "/", index_handler);

Where index_handler is a function that takes in a pointer to an http_req_t and http_resp_t. It modifies the http_resp_t before returning to send a response.

More examples can be found in main.c.

Building

Requires GCC and GNU Make.

$ make setup
$ make

The compiled binary will be located at dist/chttp.

TODO

  • Dynamic route parameters
  • Better standards compliance

About

an http server in c

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published