Reputation: 1294
I need to build a lightweight http server for my application basically it's a server which listen to a port and outputs a status information on requests, https, other functionality. But I would like to know first if something like this existe in C++, for linux and open source.
Does anyone know a program like that?
Thanks.
EDIT: It should be able to support high load.
Upvotes: 1
Views: 10889
Reputation: 31271
If you want to handle high loads I would suggest following:
Use proper web server with all goodies it comes with like Lighttpd, Nginx or Apache (in that order).
It would do great job in serving static files and handle your application. And they are very lightweight.
Disclaimer: I'm the author of CppCMS
Upvotes: 2
Reputation: 43327
See thttpd. Supposibly the fastest open source file server on all machines with a single CPU.
Upvotes: 0
Reputation: 43327
If not using HTTPS, it's about a two hour exercise to write a static file server.
Upvotes: -1
Reputation: 7228
A quick google search for "C++ web application framework" shows things called CppCMS and something else called WT. That might get you started.
Or, as Sam already answered: boost.asio comes with a HTTP example that may be sufficient if your needs are simple. (Real HTTP request handling is actually surprisingly complex: http://webmachine.basho.com/diagram.html )
Upvotes: 0
Reputation: 24174
If you can use boost, the asio library provides an http example. It does not use SSL, but asio can use OpenSSL very easily.
Upvotes: 6