Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTTP Client library for C++

Tags:

c++

I'm trying to write milt-threaded HTTP proxy for learning C++/socket/HTTP

I'm looking for a HTTP client library like HttpURLConnection available in Java.

I looked at some libraries eg, libcurl for C/C++. These libraries can make http request but they will return with the full content. I need a library that can read content partially in a buffer so that I'm able to ship it immediately to requesting client, without storing the entire content in memory.

Any links/suggestions is highly appreciated :)

thank you!

like image 367
user406481 Avatar asked Mar 18 '11 05:03

user406481


1 Answers

libcurl docs have an example page on how to get incremental download callbacks (into a memory buffer) as data streams in from a request:

http://curl.haxx.se/libcurl/c/getinmemory.html

In your case, you would just forward the data buffer on to the client that originally made the request.

like image 53
selbie Avatar answered Oct 01 '22 09:10

selbie