libmicrohttpd

Lightweight HTTP/1.1 server library for embedding web servers in applications

brewmacoslinux
Try with needOr install directly
Source

About

Light HTTP/1.1 server library

Examples

embed a simple web server in a C application$ gcc -o myserver myserver.c `pkg-config --cflags --libs libmicrohttpd`
create a REST API server that responds to HTTP requests$ gcc -o api_server api.c -lmicrohttpd && ./api_server
build a minimal web server with custom request handlers$ #include <microhttpd.h> // Then implement MHD_AccessHandlerCallback
handle multiple concurrent HTTP connections in an application$ MHD_start_daemon(MHD_USE_SELECT_INTERNALLY, port, NULL, NULL, &handler, NULL, MHD_OPTION_END);
serve files or dynamic content over HTTP from your program$ gcc -o webserver server.c -lmicrohttpd && ./webserver --port 8080