cURL / Mailing Lists / curl-library / Single Mail


Unable to send GET request via proxy tunnel

From: Роман Шаметько <>
Date: Tue, 18 Feb 2014 16:24:40 +0300


I'm trying to send GET request through proxy using tunnelling.
Expected behaviour:
1. Tunnel over proxy is created.
2. GET request is sent via tunnel.
Actual behaviour:
1. Tunnel over proxy is created.
2. GET request is sent not along the tunnell, as expected, but itself. This
behaviour results in impossibility to sent such request if proxy requires
authorization, because request is sent without proxy-authorization header.

For some strange reason this bug is reprodused with GET requests only: HEAD
seems to work just fine.

Development environment:
Windows 8 x64
libcurl version 7.19.7 (aslo reproduced on 7.35.0)
visual studio 2005 (without service pack)
proxy: fiddler v4.4.5.9

Following code sample demonstrates this behaviour:

#include "stdafx.h"
#include "curl/curl.h"
#include "curl/types.h"
#include "curl/easy.h"

#include <iostream>

char* url = "";
char* host = "Host:";/**/

void perform(char* method)
    CURL* curl = NULL;

    curl = curl_easy_init();

    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, method);
    curl_easy_setopt(curl, CURLOPT_URL, url);
    curl_easy_setopt(curl, CURLOPT_CRLF, 0);

    curl_slist list; = new char[strlen(host) + 1];
    memset(, 0, strlen(host) + 1);
    strcpy(, host); = NULL;

    curl_easy_setopt(curl, CURLOPT_HTTPHEADER, &list);

    curl_easy_setopt(curl, CURLOPT_MAX_SEND_SPEED_LARGE, 0);
    curl_easy_setopt(curl, CURLOPT_MAX_RECV_SPEED_LARGE, 0);/**/

    curl_easy_setopt(curl, CURLOPT_PROXY, "");
    curl_easy_setopt(curl, CURLOPT_PROXYPORT, 8888);
    curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
    curl_easy_setopt(curl, CURLOPT_PROXYUSERNAME, "123");
    curl_easy_setopt(curl, CURLOPT_PROXYPASSWORD, "123");
    curl_easy_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1);

    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
    curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
    curl_easy_setopt(curl, CURLOPT_TIMEOUT, 120);



int _tmain(int argc, _TCHAR* argv[])

return 0;

List admin:
Received on 2014-02-18