views:

208

answers:

4

I am looking for an HTTP library for C/C++, that handles only the protocol logic, instead of the actual transport mechanism. Libraries I've came across tend to incoperate the entire communication process, which is not what I need.

However, I'm looking for something that's more than merely an HTTP parser. Ideally it would also take care of things such as session/connection management, multiplexing, etc... only that it would leave the actual implementation of the communication details for application to perform. I'm looking at both client and server ends, though any of them would be helpful.

Preferably I'm looking for something that's free (non GPLed, though). HTTPS is a plus. Lightweightness is a plus. Simplicity is a big plus.

Anything like this?

A: 

The problem is that once you want it to do session management, it's a LOT simpler to write the library to include the transport (usually sockets) handling directly, rather than try to define a usable interface that the application can implement to do the underlying transport work. Especially since most (obviously not all) users need both components anyway.

Michael Kohne
A: 

Have u tried curl library ? It may help

cppdev
+1  A: 

I think the best thing you are going to find is one that implements it in a well separated manner. An HTML Server without a socket implementation is useless to most of the world. I would look for well separated code. Here is an example of a very minimalistic html server that seems it may be well separated, not completely sure, as I have not tried it myself, but you could replace the socket classes with your own implementation and wrappers, and do it that way.

http://www.adp-gmbh.ch/win/misc/webserver.html

There may be other examples out there as well. A good google search may be your friend here. At any rate, I don't think you are going to find a totally disconnected server and client that is totally abstracted from the socket implementation(s) that they use. I've had to do this myself before, to write an html client that did not use sockets, but used serial io to another device, that would pass the data through onto the wider internet.

Jay Kramer
A: 

If you want a subset of a web-server read the source-code of an open-source server and strip out what you don't need. You might want to look at lighttpd and nginx. They are simple lightweight web-servers.

Hassan Syed