cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Using CURLOPT_PROXY to turn off proxy use?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 22 Feb 2007 22:10:14 +0100 (CET)

On Thu, 22 Feb 2007, Adam D. Moss wrote:

> Having upgraded to 7.16.1, the same call doesn't appear to override the
> environment vars - the HTTP PUT goes through the proxy.
>
> I see that using "" as a CURLOPT_PROXY isn't a documented way to turn off
> HTTPing proxying for a handle; is it still supposed to serve this purpose?
> Is there a better way to skip any proxying for a handle?

I think it sounds like a regression... and that it is an additional bug that
the docs doesn't mention this way. And I figure we should add a test case that
verifies that this works...

However, using the current CVS with a test snippet like below it seems to work
fine for me:

int main(void)
{
   CURL *curl;
   CURLcode res;

   setenv("http_proxy", "bad-host-name-non-existing.moo", 1);

   curl = curl_easy_init();
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "curl.haxx.se");
     curl_easy_setopt(curl, CURLOPT_PROXY, "");
     curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
     res = curl_easy_perform(curl);

     /* always cleanup */
     curl_easy_cleanup(curl);
   }
   return 0;
}

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2007-02-22