8 #include <sys/socket.h>
17 std::ostringstream oproxy;
18 oproxy <<
"localhost:" <<
port_;
24 CURL* han = curl_easy_init();
27 XCEPT_RAISE(
evf::Exception,
"could not create handle for SquidNet fisher");
29 char error[CURL_ERROR_SIZE];
32 struct curl_slist *headers=
NULL;
34 headers = curl_slist_append(headers,
"Pragma:");
36 curl_easy_setopt(han, CURLOPT_HTTPHEADER, headers);
38 curl_easy_setopt(han, CURLOPT_PROXY,
proxy_.c_str());
40 curl_easy_setopt(han, CURLOPT_URL,
urlToGet_.c_str());
42 curl_easy_setopt(han, CURLOPT_WRITEFUNCTION, &
write_data);
43 curl_easy_setopt(han, CURLOPT_WRITEDATA, &dummy);
44 curl_easy_setopt(han, CURLOPT_ERRORBUFFER, error);
45 int success = curl_easy_perform(han);
47 curl_slist_free_all(headers);
49 curl_easy_cleanup(han);
static size_t write_data(void *ptr, size_t size, size_t nmemb, void *pointer)
SquidNet(unsigned int, std::string const &)