All Projects → jkuhlmann → bbhttpd

jkuhlmann / bbhttpd

Licence: other
Barebones HTTP daemon to drop into your project

Programming Languages

c
50402 projects - #5 most used programming language

bbhttpd - The barebones HTTP daemon

A HTTP server that can easily be dropped into your existing project to help with debugging and development.

Features

  • Only one source file and one header file. Just drop the files into your project, no need to build a library and link to it.
  • No unnecessary features. You get the HTTP request and send back a response.
  • C89-compliant C code
  • MIT license

Usage

#include "bbhttpd.h"

bbhttpd_config_t config = BBHTTPD_CONFIG_INIT;
bbhttpd_t* bbhttpd = bbhttpd_start(&config);

while (!do_exit)
{
	bbhttpd_request_t* request = bbhttpd_get_request(bbhttpd);
	if (request)
	{
		const char* test_response = "Hello, world!";
		bbhttpd_response_t response;
		response.status = 200;
		response.body = test_response;
		response.body_length = strlen(test_response);
		bbhttpd_send_response(bbhttpd, request, &response);
	}
}

bbhttpd_stop(bbhttpd);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].