cURL / Mailing Lists / curl-library / Single Mail

curl-library

Can't resolve host

From: Mathieu Fregeau <mathieu.fregeau_at_gmail.com>
Date: Thu, 5 Mar 2015 16:52:42 -0800

Hi

library version: curl 7.41.0
compiler: c++, mingw32 (gcc 4.8)

I can't resolve my request when at the office computer, while it works well at home. I suspect something about firewall, but I can browse on the same url via a browser (firefox and ie). Is there a way to have curl use the same exact settings of the current browser? such that I can use the same channels or firewall bypass?

Here are my request settings:

curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);//follow redirection
curl_easy_setopt(curl, CURLOPT_REFERER, url);
curl_easy_setopt(curl, CURLOPT_HEADER, 0L);
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1L);//no progress
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);//1=verbose, 0=non verbose
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_WHATEVER);
curl_easy_setopt(curl, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE | CURLPROTO_SCP);
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912 Safari/535.7 Firefox/3.5.16");
curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1L);
curl_easy_setopt(curl, CURLOPT_FAILONERROR, 1L);//report failure for http code > 400
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, CurlWriteFunction);//function to keep response
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &body);// keep response in variable

res = curl_easy_perform(curl);

like I said it works from my home computer but just not at work.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-03-06