News for hackers. Stuff that matters.
Re:H2O – an optimized HTTP server and library implementation by marktangotango on Friday September 19, 2014 @04:59PM (#8342471)
Very nice, I've often wondered at the lack of embeddable http servers in the c/c++ world. Are there any other libraries that do the same thing? What is the status of this project? Is it being used in production anywhere?
Re:H2O – an optimized HTTP server and library implementation by to3m on Friday September 19, 2014 @06:46PM (#8342886)
I wrote one: https://github.com/tom-seddon/yhs (README includes a bunch of links to others at the bottom)

I wrote it for an iOS game, the idea being that configuration of the game would be done in real time by connecting to your iThing via a web browser and tweaking it using a bunch of HTML widgets or whatever. But its intended users ended up preferring to do their tweaking using some on-screen Cocoa Touch stuff that I'd also put in, so the HTML idea never ended up being taken further.

My library has a few good points, I think: no dependencies, no threading, easy integration, simple API, builds as C89/C99/C++, doesn't hate Windows. (I've often wished other libraries did all of those.) But I don't currently have any plans to work on it further, and you can probably find other options that have been more thoroughly battle-tested, were more carefully planned, and are actively maintained.

(These days I'm more comfortable with Javascript, and I've come to the conclusion that a better approach would be to implement a bare bones WebSocket server that does little more than let the iWhatever send data to the browser and vice versa. No need for the iDevice to serve any HTML or cooked data or anything like that; just send raw data and interpret it in your JS code, which of course would be stored locally on your PC, along with associated HTML/CSS/etc. Quicker turnaround during development, and easier to push updates to its users, who would probably just need to get latest and hit refresh in the browser as they'd be running it straight from their working copy.)

Re:H2O – an optimized HTTP server and library implementation by fredliu on Friday September 19, 2014 @05:20PM (#8342550)
Another example is Mongoose. It's small, easy to config and embeddable(I've used Mongoose on android with NDK with no problem). Unlike H2O, Mongoose is using an old school one-thread-per-request approach, so I would expect the throughput won't be as high as H2O, which seems to be using an event based approach similar to ngnix. Be aware of the license of Mongoose though, it used to be MIT (or apapche?), but now it's GPLv2.
Re:H2O – an optimized HTTP server and library implementation by nodivbyzero on Friday September 19, 2014 @05:48PM (#8342671)
Re:H2O – an optimized HTTP server and library implementation by reverius42 on Friday September 19, 2014 @07:50PM (#8343105)
Re:H2O – an optimized HTTP server and library implementation by sircomatose on Saturday September 20, 2014 @04:54AM (#8344061)
There is kore. See https://kore.io and https://github.com/jorisvink/kore

Has quite alot of neat features for C web development imho, then again I wrote it so of course I like it.

Re:H2O – an optimized HTTP server and library implementation by lultimouomo on Friday September 19, 2014 @06:52PM (#8342915)
cpp-netlib provides an embeddable HTTP server based on boost::asio, which adopts a proactor pattern. As with all things boost, it is well made and elegant, and takes a bit getting used to.

The Poco Net libraries include a more traditional thread-per-request server which is very easy to use, with a clean OO approach.

I think ACE includes an HTTP server as well, but I have no experience with it.

Re:H2O – an optimized HTTP server and library implementation by nly on Saturday September 20, 2014 @06:22AM (#8344191)
For C, libmicrohttpd

https://www.gnu.org/software/libmicrohttpd/

Big list of alternative libraries at the bottom also.

Re:H2O – an optimized HTTP server and library implementation by dmoreno on Monday September 22, 2014 @09:24AM (#8350421)
There is also libonion (https://github.com/davidmoreno/onion), another high performance HTTP library.

It also has C and C++ support, with very clean API, django-like templates, initial Python and PHP bindings, Websocket, Webdav, has several threading modes (poll, pool, one thread...) And many other goodies.

Disclaimer: Im the author.