cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: proxy tunnel and custom headers

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 22 Jul 2010 13:24:01 -0700

On Thu, Jul 22, 2010 at 09:58:41PM +0200, Patricia Muscalu wrote:
> How do I prevent Transfer-Encoding header from being included in the CONNECT
> request?
> The following combination of curl options will hang the proxy:
>
> curl_easy_setopt (curl, CURLOPT_HTTPPROXYTUNNEL, 1L);
> chunk = curl_slist_append(chunk, "Transfer-Encoding: chunked");
> curl_easy_setopt(curl, CURLOPT_HTTPHEADER, chunk);
> curl_easy_setopt (curl, CURLOPT_PROXY, "localhost");
> curl_easy_setopt (curl, CURLOPT_PROXYPORT, 7777);
> curl_easy_setopt (curl, CURLOPT_PROXYAUTH, CURLAUTH_ANY);
> curl_easy_setopt (curl, CURLOPT_PROXYUSERNAME, "proxyuser");
> curl_easy_setopt (curl, CURLOPT_PROXYPASSWORD, "proxypasswd");

You shouldn't need to set the Transfer-Encoding header yourself. curl will
take care of setting it correctly as needed.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-22