2

I have a C++ app and looking for a library that would make it a HTTP Server that's able to serve static files as well as perform very simple tasks. The only constraint 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 does other tasks. I want to provide a way so you can access http://localhost:9999/performtask or http://localhost:9999/viewstatus

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

1
  • Your question really isn't clear. do you have some functionality that you want to serve via the web? Commented May 17, 2009 at 0:26

8 Answers 8

5

In a question which has since been deleted, I asked:

I'm looking for a well-written, flexible library written in C or C++ (I'm writing my apps in C++) that can be used to embed an relatively simple HTTP server into my applications. Ultimately I will use this for application monitoring and control.

There are a number of great client-side libraries (e.g. libwww, neon, curl) but I'm struggling to find a good solution for the server-side. I'm sure other folks have done this before, so I'd love to hear what folks have done and what has worked and what hasn't.

I ended up choosing Mongoose.

Sign up to request clarification or add additional context in comments.

4 Comments

Exactly what I need (points++ for Mongoose doing threading) Thanks!
or use Civetweb if you can't use GPL - this is based on the original, MIT licensed version of Mongoose.
Question link has been deleted, please edit the text.
@AliBigdeli fixed. Kept the link in case the question is undeleted (I've requested it be), but pasted the body here as well.
1

The Wt library does exactly this. Recommended, especially if your user interface gets more complex.

1 Comment

+1 Wt is best library I have found. Good example code. Bad documentation. Easy if you have Qt background.
1

I accomplished the same thing you want to accomplish by 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 perfect solution for me, because my project was already dependent on boost::thread and boost::asio, so the HTTP Server example code fit into my application and I could easily have complete control over its threading behavior. I just copied HTTP Server example files into my project and customized the request-response logic.

Comments

1

Just a thought !

Why don't you convert your c++ application code to a native/extension module for any of the following http servers.

  • Apache Webserver
  • IIS 7.0 native module
  • Nginx
  • LightHttpd

All the above servers except IIS are cross platform.

Maybe building an extension module would yield a better output and the above server are very scalable too.

Comments

0

I am partial to the poco library as a starting point.

Comments

0

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

Comments

-1

Qt framework have buildin webkit. have a lookinto that.

Comments

-2

Java would be a better choice for a cross-platform solution plus it has good web services apis. Take a look at Netbeans it is a good way to get started.

1 Comment

This would be a good route to take, except the application is already written, it has to be C or C++

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.