3 ms·
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 sta
by marktangotango 12y ago
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?
- fredliu 12y agoAnother 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.
- nodivbyzero 12y agohttps://code.google.com/p/mongoose/ https://code.google.com/p/mongoose/
- reverius42 12y agoSee also https://github.com/pfalcon/mongoose-mit https://github.com/pfalcon/mongoose-mit or https://github.com/sunsetbrew/civetweb https://github.com/sunsetbrew/civetweb
- to3m 12y agoI wrote one: https://github.com/tom-seddon/yhs 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.)
- lultimouomo 12y agocpp-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.
- sircomatose 12y agoThere is kore. See https://kore.io https://kore.io and https://github.com/jorisvink/kore 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.
- nly 12y agoFor C, libmicrohttpd https://www.gnu.org/software/libmicrohttpd/ https://www.gnu.org/software/libmicrohttpd/ Big list of alternative libraries at the bottom also.
- dmoreno 12y agoThere is also libonion (https://github.com/davidmoreno/onion 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.