Take the 2-minute tour ×

I am planning to build a bunch of C++ based process to provide data as HTTP rest api on the front-end. I have been trying to decide if it is better to build in the HTTP server or to use FastCGI in the C++ processes. In either case the processes will be behind some webserver like nginx. To me it seems like FastCGI is simpler and would be easier to work with then having a fully HTTP server. FastCGI would also seem fast, not that it would matter much. I see testing would be easier if the C++ processes had HTTP built in just connect directly to it for internal use, but I have not found a simple C++ HTTP server library that I like yet. I am looking any other pro or cons.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

I found libevent has a simple http server built in. I have been using it and am very happy. I am using Qt and had to do a little work to put a wrapper around libevent in a thread, but it works great and is very simple.

share|improve this answer

G-wan webserver, a 200 KB executable file, lets you write ANSI C scripts that are edited and executed on-the-fly (more convenient than fastCGI: all the HTTP work is done transparently).

You can also link any C/C++ library to G-WAN C scripts with "#pragma link".

Good luck with your project!

share|improve this answer

Don't even think of writing your own HTTP server unless you have a very clear and legitimate need to do so (which doesn't seem to be the case here). Go for FastCGI or even SCGI, which is a much simpler protocol to implement than FastCGI if you don't want to use a library or if you have specific needs for such an implementation.

share|improve this answer
I agree I don't want to write my own HTTP server. I did find code.google.com/p/mongoose and might look at it. Will have to look a SCGI. –  masebase Oct 28 '11 at 22:28

Your Answer


