-1

I am looking at developing a HTTP-based server for storing and later retrieving internal assets (just files/blobs of data). Clients should be able to connect with a simple HTTP request and retrieve data, or use a RESTful API to store files.

When a file is stored, we will need to make some calls into preexisting C++ code to update our asset database, set up internal linkages, and run various checks (e.g. is the data sane).

We have mountains of existing C++ tech here and it's not going to be practical to rewrite it in a high-level language, so we'd like to reuse as much of that as we can. However, in our brief research, it seems like putting together a performant HTTP server is absolutely trivial in higher-level languages, and we'd like to use as much off-the-shelf tech as possible for the HTTP server part.

Anyone have any experience/insight with this? We looked at Node.js, and it seemed very powerful, and then we looked at its C++ integration and got scared off. We aren't going to be able to rewrite all of our low-level tech to be non-blocking, and Node.js seems to require that. Others suggested Ruby, which we have some experience with, but we've never added C++ to the mix before. Totally open to other ideas as well.

Thanks guys!

StilesCrisis
  • 15,972
  • 4
  • 39
  • 62
  • What about C++/CLI?? I would think you could wrap your existing C++ into .Net-friendly libraries. Should allow a natural transition to .Net. ...then you have C# which should be fairly easy for most C++'ers to transition to. – IAbstract Jun 26 '12 at 01:28
  • OK, what does C# buy us in terms of easily implementing a performant, RESTful HTTP server? – StilesCrisis Jun 26 '12 at 01:31
  • http://stackoverflow.com/a/4642746/210709 for some starting reference. In addition, and being only *somewhat* sarcastic :) ...if you can't find a .Net library (or software ...or service) that does what you want, you aren't looking ...seriously though: http://msdn.microsoft.com/en-us/library/dd203052.aspx ...hope that helps. – IAbstract Jun 26 '12 at 01:39

2 Answers2

2

I would use http://code.google.com/p/mongoose/ . Mongoose is written in C and easily integrated into existing code.

Markus Schumann
  • 7,636
  • 1
  • 21
  • 27
  • +1. It's ridiculously easy to get started with, very much performant, and fairly short & to the point. – Mahmoud Al-Qudsi Jun 26 '12 at 02:29
  • For what it's worth, Mongoose did in fact integrate easily and does what we need. It's a litter closer to the metal than I expected, but it's extremely simple to get started and I have yet to run into any problems. They clearly worked hard to make it integrate simply into almost anything. – StilesCrisis Sep 07 '13 at 03:17
0

Maybe you can try poco: http://pocoproject.org/features.html Poco is a good c++ library and they provide a HTTP server framework.

lenx.wei
  • 86
  • 3
  • That looks cool, but I think I will be crucified if I bring in a giant monolithic C++ library. Boost is not well-loved here. – StilesCrisis Jun 26 '12 at 23:36
  • If boost isn't well-loved here, woe to the guy who wants other libraries. Some parts of boost are just literally a single, short header file. – Arafangion Feb 04 '13 at 01:51