eldar85
22.04.2010, 16:44
сталкнулся с такой проблемой, не могу разобраться. если включить либкурл без прокси серверов, то скорость как у ракеты, а через прокси прога реально тормозит, загрузка страниц выполняется очень медленно, уже и прокси через прокси-чекер пропускал и тайм аут у прокси чекера ставил 3 секунды, отбирал самые хорошие, но скорость один хрен неочемская... в чем может быть косяк???
вот так устанавливаю прокси
string proxy = "85.137.233.2:8085";
.....
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HEADER, header);
curl_easy_setopt(curl, CURLOPT_PROXY, proxy.c_str());
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, followFlag);
curl_easy_setopt(curl, CURLOPT_REFERER, referer.c_str());
curl_easy_setopt(curl, CURLOPT_NOBODY, disBodyFlag);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "c:/cookie.txt");
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "c:/cookie.txt");
curl_easy_perform(curl);
....
вот так устанавливаю прокси
string proxy = "85.137.233.2:8085";
.....
curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorBuffer);
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_HEADER, header);
curl_easy_setopt(curl, CURLOPT_PROXY, proxy.c_str());
curl_easy_setopt(curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, followFlag);
curl_easy_setopt(curl, CURLOPT_REFERER, referer.c_str());
curl_easy_setopt(curl, CURLOPT_NOBODY, disBodyFlag);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, writer);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &buffer);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, 10);
curl_easy_setopt(curl, CURLOPT_COOKIEJAR, "c:/cookie.txt");
curl_easy_setopt(curl, CURLOPT_COOKIEFILE, "c:/cookie.txt");
curl_easy_perform(curl);
....