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/
a source to share
The Wt library does exactly that. Recommended especially if your user interface is getting more complex.
a source to share
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.
a source to share
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.
a source to share
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.
a source to share