cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Need urgent help for HTTPS

From: amit paliwal <amit.ambitions_at_gmail.com>
Date: Wed, 24 Nov 2010 10:07:52 -0500

Hi Dan,

Thanks for the reply. I appreciate. Well My protocol is definitely on top of
HTTPS. When I was using libcurl for the first time, I am able to send a GET
request to a Server and then when server sends some message then my callback
mentioned in writedata gets called, all this happens when I say
curl_easy_perform().

the sequence that I want to generate is:
1) I will send a GET request to my server
2) Server will reply.
3) server can send asynchronous messages and I will have to read it.
4) I can also send asynchronous messages and reply to the messages coming
from server.

Now I am able to do till step3, but I am confused that once I prepare the
response message of the message received from Server, how can I ask libcurl
to read data from my read callback function. I believe I will have to do
curl_easy_perform() again. Am I right here? I tried following:

1) once i get message from server in my write callback function I parsed it
successfully.
2) now I want to prepare response message, which will be sent on top of HTTP
GET and send to server, for that i want libcurl to read data from my read
callback function, this is not happening now, what shall I do????

Please help me out in this, I appreciate the time you are puttting to help
me.

On Wed, Nov 24, 2010 at 2:56 AM, Dan Fandrich <dan_at_coneharvesters.com>wrote:

> On Mon, Nov 22, 2010 at 05:37:06PM -0500, amit paliwal wrote:
> > I am planning to use libcurl for my application. I am developing one
> > proprietary protocol which will be communicating with server on top of
> HTTPS.
> > Now I am not getting how can I make use of libcurl.
>
> If your proprietary protocol truly runs "on top of HTTPS", then you'll have
> no problem at all. Just do your GET/POST/WHATEVER operations like normal,
> and libcurl will handle it fine. If your protocol doesn't actually use
> HTTPS
> but rather a variant that only vaguely looks close enough to HTTPS to get
> through some proxy servers, then you might have a problem.
>
> > When I apply CONNECT_ONLY option, it means send() and receive() should be
> done
> > by me, and in that case I will not be able to use HTTP support provided
> by
> > library.
> >
> > If I allow curl to do things on behalf of me, then by giving write
> callback, I
> > am able to receive the data but then I am not able to send the data to my
> > server.
>
> This makes it sound like your protocol falls into the "only superficially
> similar to HTTPS" category. If it were truly HTTPS, then you would set up
> a POST (or PUT) transfer, send the data to the server from the
> READFUNCTION then save the response through the WRITEFUNCTION.
>
> > Please help me in understanding hwo to do it, or can I do it by using
> libcurl
> > or not.
>
> It really depends on the protocol. If it's on top of HTTPS, then libcurl
> can
> do it all. If it's just designed in such a way that CONNECT_ONLY
> can get establish the connection, then you should be able to start using
> curl_easy_send/recv to bang arbitrary encrypted data out and receive
> responses.
>
> >>> Dan
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-11-24