cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: send data over socket using libcurl

From: Dhiren <simplydhirendra_at_gmail.com>
Date: Thu, 8 Jan 2009 10:02:13 +0530

I have to write a application that send data over socket by using
curl-library via Proxy so can you provide me a basic code for this .

Thanks for giving a response

On 1/8/09, Daniel Stenberg <daniel_at_haxx.se> wrote:
>
> On Wed, 7 Jan 2009, Dhiren wrote:
>
> This topic is libcurl related so the curl-library is clearly a more
> suitable mailing list!
>
> 1. i had used diffrent formate to send data .
>> //char *request = "GET https://202.189.252.134:80 HTTP/1.1\r\n";
>> char *request = "GET / HTTP/1.1\r\nHost: 202.189.252.134\r\nConnection:
>> Close\r\n\r\n";
>> // char *request = "connect to server.";
>>
>> for curl_easy_send. and it's return CURLE_OK. but getting problem in
>> curl_easy_recv
>> it's return proxy error :
>> HTTP/1.1 502 Proxy Error ( The Uniform Resource Locator (URL) does not use
>> a
>> recognized protocol. Either the protocol is not supported or the request
>> was
>> not typed correctly. Confirm that a valid protocol is in use (for example,
>> HTTP for aWeb request). )
>>
>
> Why are you doing this complicated anyway? Why can't you just send the
> stuff using the "normal" way?
>
> "GET /" is not a legal request to a proxy so of course it'll return an
> error back. See RFC2616 for details.
>
> 2. when using
>> char *request = "connect to server."; // for send buffer
>> and at server a application listning the port 443 and when get connect
>> send
>> a response on same socket.
>> then getting response null curl_easy_recv. and CURLcode = CURLE_AGAIN
>>
>> so please give me the solution where i am going wrong.
>>
>
> CURLE_AGAIN is quite a normal situation. What's the problem with that?
>
> please help me it's very urgent .
>>
>
> Isn't it always? If you really want a fast solution my advice is: use a
> traditional libcurl approach and consider hiring a professional to do it for
> you.
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

-- 
Thanks and Regards
Dhirendra Kumar
Software Engineer
Tera Informatics Pvt. Ltd.
111, SDF - 4, Seepz
Andhari(E) , Mumbai
Mob - 9967462468
           9324917396

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-01-08