Exposing a C ++ application to an HTTP web server function

I have a C ++ application and you are looking for a library that will make it an HTTP server that can serve static files and also perform very simple tasks. The only limitation is that it must be cross platform.

What are my options.

Clarify: I need a web interface for my application. This application is a background program that performs other tasks. I want to provide a way so that you can access http: // localhost: 9999 / performtask or http: // localhost: 9999 / viewstatus

clarification2: something like this http://www.gnu.org/software/libmicrohttpd/

+1


a source to share


8 answers


See this question . I decided to choose Mongoose .



+5


a source


The Wt library does exactly that. Recommended especially if your user interface is getting more complex.



+1


a source


I have accomplished exactly what you want to accomplish using the HTTP Server example for boost :: asio.

http://www.boost.org/doc/libs/1_43_0/doc/html/boost_asio/examples.html

This was a great solution for me, because my project was already dependent on boost :: thread and boost :: asio, so the HTTP server example code would fit into my application and I could easily get full control over its threading behavior. I just copied the HTTP server example files into my project and set up the request-response logic.

+1


a source


Just a thought!

Why don't you convert your C ++ application code to native / add-on module for any of the following http servers.

  • Apache web server
  • Native IIS 7.0 module
  • Nginx
  • LightHttpd

All of the above servers except IIS are cross-platform.

Perhaps building a plug-in will give a better result and the above server will be very scalable too.

+1


a source


As a starting point, I am partially referring to the poco library .

0


a source


Take a look at Snorkel is a lightweight cross-platform embedded / application server SDK that allows you to quickly add web interfaces to any C / C ++ application. It's free and can be found at http://sites.google.com/site/snorkelembedded . It is faster than a mongoose.

0


a source


Java will be the best choice for cross platform solution plus it will have good web apis. Take a look at Netbeans, this is a good way to get started.

-1


a source


The Qt framework has webkit built in. take a look at this.

-1


a source







All Articles