cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: HTTP encapsulation with libcurl

From: Lars Nilsson <chamaeleon_at_gmail.com>
Date: Tue, 16 Jun 2009 18:36:38 -0400

On Tue, Jun 16, 2009 at 6:06 PM, Daniel Stenberg<daniel_at_haxx.se> wrote:
> On Tue, 16 Jun 2009, Michael Koehler wrote:
>
>> I am currently trying to communicate to a server using HTTP. I have to
>> encapsulate the HTTP communication in another message-based protocol for the
>> communication which requires me to receive the HTTP request created by curl
>> as a string. The received string would then go into the tunnel protocol. The
>> same counts for the HTTP response which I extract first from the other
>> protocol before I can "hand it over" to libcurl.
>
> Well, if that "other layer" is featured with sockets, you could use
> CURLOPT_OPENSOCKETFUNCTION and have libcurl use it "by magic".

Perhaps implementing a custom proxy, using a socket towards libcurl
(using the option above) and whatever else is needed towards the
server, and relay the information as it becomes available in both
directions? Assuming a best-case scenario where interaction models
doesn't differ too much..

Lars Nilsson
Received on 2009-06-17