tags:

views:

1975

answers:

7

I am working on a project where I need to embed a web server into my C++ application. I am looking for an open-source library supporting SSL, written in C or C++ and with a licensing scheme that will allow me to link it into my existing closed source code. Any suggestions of specific products or where to look first?

+4  A: 

You can take a look on Boost.Asio examples -- there is an http server.

Other option, if you can except embedded server is using thttpd and CGI --- this is standard approach for embedded web applications.

You can also connect your application to the server with SCGI/FCGI.

Artyom
After I posed this I ended up looking at the boost examples and I think that is exactly what I need.
MGoDave
+9  A: 

I use Mongoose - it works well, it's FOSS, supports SSL, it's written in C and is very easy to embed in C or C++ code. The maintainer is very responsive to issues and improvement requests.

anon
+1 for Mongoose. Really simple, functional, and easy to integrate.
Bklyn
+1  A: 

Are you sure you need it internally and not as a separate application?

Because if you don't mind setting a 3rd party server, busybox (no https) or lighttpd (very good idea to use it IMHO) are good candidates.

elcuco
It definitely needs to be embeddable, but these are all good things to keep in mind for the future.
MGoDave
+4  A: 

Lighthttpd is embedable. That's what Transmission uses. I'm not sure if it works on windows. Libevent has an http implementation and it works on windows.

Vasil
A: 

You may give a look to libmicrohttpd. It's LGPL, portable and embeddable ;)

However, I agree with Neil Butterworth. You can also use Mongoose ;)

Markon
A: 

I have written a high performance embedded web server-library called snorkel, which is portable and free. I currently have binaries for both Windows and Linux. I will be posting an article about it on Code Guru in a couple of weeks. It leverages NUMA topology for memory management and performance.

Walter Capers
A: 

Take a look at Snorkel. Its one of the fastest easiest to use embedded web servers. http://sites.google.com/site/snorkelembedded

Walt C.