curl-library
proxy tunnel and custom headers
Date: Thu, 22 Jul 2010 21:58:41 +0200
Hi,
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");
The proxy ACK:s CONNECT and waits for data to come because of the
Transfer-Encoding is included in the proxy request.
The application waits for 407 response from the proxy.
Output:
* About to connect() to proxy 192.168.0.1 port 7777 (#0)
* Trying 192.168.0.1... * connected
* Connected to 192.168.0.1 (192.168.0.1) port 7777 (#0)
* Establish HTTP proxy tunnel to 192.168.0.1:8080
> CONNECT 192.168.0.1:8080 HTTP/1.0
Host: 192.168.0.1:8080
Proxy-Connection: Keep-Alive
Transfer-Encoding: chunked
^C
Thanks for any good words,
Patricia
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2010-07-22