1

The requirement is to have Linux machine without additional installations aka Java, apache tomcat/jboss, that will be able to serve as a web server and to accept web service request (I will have to write some web service in C++ that will serve under this web server).

So, the question is if there is some C++ library that provides such a simulation of web server, since from outside it should behave the same way - to get http request and to redirect to appropriate web service.

Nata
  • 45
  • 6

3 Answers3

2

Wrong place to ask (softwarerecs is probably more appropriate), but you probably want to use some HTTP server library like libonion, or libmongoose, or even Wt etc. All these libraries enable adding some web serving abilities to your application (e.g. to code your Web server application in a few dozen of lines of C++).

BTW, if coding in Ocaml consider using Ocsigen or Ocamlnet.

If you also want an HTTP client library, consider libcurl

You might also be interested in fastcgi. Several existing web servers are able to handle some web requests to a FastCGI application.

If you want to filter or transform HTTP requests, consider ICAP

You need to be familiar with the basics of web technologies (HTTP, HTML5, Javascript, AJAX, Websockets, Jquery, ...) see e.g. w3schools (which is inperfect).

You might also need some database or indexed file library, like sqlite or GDBM

Community
  • 1
  • 1
Basile Starynkevitch
  • 223,805
  • 18
  • 296
  • 547
  • Thanks for the input. I'll check the options. I need web server, actually. P.S. Why it is a wrong place? – Nata Feb 02 '15 at 15:56
  • The HTTP server libraries I mention enable you to write your own specialized web server in a few dozen of source lines. – Basile Starynkevitch Feb 02 '15 at 15:58
  • Wrong place to ask, since your question is not related to your existing source code. – Basile Starynkevitch Feb 02 '15 at 15:59
  • I'll mark your comment as an answer, although I'm going in another direction - gsoap. But your comment was the most informative. Libmongoose seems really impressive. – Nata Mar 13 '15 at 17:51
0

You can make a very simple http server using node.js, answer copied from here:

Using node.js as a simple web server

Simplest Node.js server is just:

$ npm install http-server -g

Now you can run a server via the following commands:

$ cd MyApp
$ http-server
Community
  • 1
  • 1
mark
  • 344
  • 3
  • 8
  • true, however I understood the question as follows: 1. I need an http server (but not apache, tomcat with many dependencies) 2. from where webservices can be executed. Using the cgi interface, this is feasible with node.js + http – mark Feb 02 '15 at 16:01
0

To complement the other answers there's also:

Cutelyst a C++11 built with Qt, with one of the best positions on TechEmpower Benchmarks.

Even though it requires Qt 5.6+ a full CMS (CMlyst) uses around 6MB of RAM while serving around 3000 requests per seconds on a single core.