I'm working on this project that uses proxy server and curl in c and i cant find a good tutorial that teaches me how to. Can you please help me?? i need an example code that shows the use of a proxy server to connect to google.com. maybe using the CURLOPT_PROXY option.. Thanks in advance.
1 Answer
Well all you do is your normal curl retrieval, but just set the proxy server option.
curl_easy_setopt(handle, CURLOPT_PROXY, "127.0.0.1:96666");
EDIT
/* create headers */
struct curl_slist *headers=NULL;
headers = curl_slist_append(headers, "Content-Type: text/xml");
/* pass our list of custom made headers */
curl_easy_setopt(easyhandle, CURLOPT_HTTPHEADER, headers);
1 Comment
Prasanth Madhavan
thanx.. but what if i needed to add some extra http headers to the request before sending them??