Wednesday, April 4, 2012

Mongoose - small embeddable web server

David Bolton is a software developer and blogger I respect very much not only for his programming skills, but also for his willingness to share his knowledge with others. He runs the best blog dedicated to programming in all falvours of C (ANSI C / C++ / C#) I have seen so far. You can find there a lot of tips, tutorials, quizes and sometimes description of interesting and yet less known software.

Recently David mentioned an interesting project called Mongoose, a small cross-platform webserver written in C. On the contrary to another beforementioned C-based web server G-WAN, which is not embeddable, closed source, and supports only Linux (Windows version can be downloaded, but is not supported), Mongoose is fully embeddable, open source and runs on Linux, Windows, MacOS X and Android. Currently Mongoose provides bindings to Python and C# as well as support for CGI scripts (including PHP), and as addition to this it can be easily embedded into your C/C++ application. Of course, if you want to retain flexibility and run C servlets along with other scripts, you can still use Tiny C Compiler through CGI. Mongoose requires no installation and can be run with one click (on Windows) or command (on Linux), so it can be used for example to easily share some files on the local network via web interface.

As a side note, there is another popular project with the same name. It is a Node.js library for MongoDB.

1 comment:

Krzysztof Kliś said...

As a side note, G-WAN's author dropped support for Windows after he accused Microsoft of cheating. He insisted that Microsoft plays unfair, because IIS runs in kernel mode and Windows user mode is deliberately slow. Whether it is questionable if Microsoft should allow third party code to run with the highest possible privileges (in my opinion it shouldn't and there is nothing to whine about), it was actually Linux web server TUX which first resorted to "cheating", as Jeff Atwood explains.